diff options
| author | realtradam <[email protected]> | 2022-11-21 04:03:29 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-11-21 04:03:29 -0500 |
| commit | 35d550df84ede11e7e2cd07c491944222491cd0e (patch) | |
| tree | f0a41067945bd89d60face7178ed60033b7cdbf1 /src/shaders | |
| parent | e413ffe66c404889a7607eaddb92f37bfaa56b69 (diff) | |
| download | Ogle-35d550df84ede11e7e2cd07c491944222491cd0e.tar.gz Ogle-35d550df84ede11e7e2cd07c491944222491cd0e.zip | |
textures :D
Diffstat (limited to 'src/shaders')
| -rw-r--r-- | src/shaders/default.frag | 9 | ||||
| -rw-r--r-- | src/shaders/default.vert | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/shaders/default.frag b/src/shaders/default.frag index 36ed030..17b84a0 100644 --- a/src/shaders/default.frag +++ b/src/shaders/default.frag @@ -1,9 +1,16 @@ #version 330 core out vec4 FragColor; + in vec3 ourColor; +in vec2 TexCoord; + +uniform sampler2D texture1; +uniform sampler2D texture2; void main() { - FragColor = vec4(ourColor, 1.0); + vec2 texInvert = vec2(TexCoord.x, -TexCoord.y); + FragColor = mix(texture(texture1, texInvert), texture(texture2, texInvert), 0.2); + //FragColor = texture(ourTexture, TexCoord) * vec4(ourColor.xyz, 1.0); } diff --git a/src/shaders/default.vert b/src/shaders/default.vert index 2e9b994..5adf795 100644 --- a/src/shaders/default.vert +++ b/src/shaders/default.vert @@ -1,11 +1,16 @@ #version 330 core layout (location = 0) in vec3 aPos; layout (location = 1) in vec3 aColor; +layout (location = 2) in vec2 aTexCoord; + +uniform float offset_x; out vec3 ourColor; +out vec2 TexCoord; void main() { - gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); + gl_Position = vec4(aPos.x + offset_x, aPos.yz, 1.0); ourColor = aColor; + TexCoord = aTexCoord; } |
