diff options
Diffstat (limited to 'examples/shaders/resources')
| -rw-r--r-- | examples/shaders/resources/shaders/glsl100/color_mix.fs | 21 | ||||
| -rw-r--r-- | examples/shaders/resources/shaders/glsl330/color_mix.fs | 22 |
2 files changed, 43 insertions, 0 deletions
diff --git a/examples/shaders/resources/shaders/glsl100/color_mix.fs b/examples/shaders/resources/shaders/glsl100/color_mix.fs new file mode 100644 index 00000000..f6ab7dcd --- /dev/null +++ b/examples/shaders/resources/shaders/glsl100/color_mix.fs @@ -0,0 +1,21 @@ +#version 100 + +precision mediump float; + +// Input vertex attributes (from vertex shader) +varying vec2 fragTexCoord; +varying vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform sampler2D texture1; +uniform vec4 colDiffuse; + +void main() +{ + // Texel color fetching from texture sampler + vec4 texelColor0 = texture2D(texture0, fragTexCoord); + vec4 texelColor1 = texture2D(texture1, fragTexCoord); + + gl_FragColor = (texelColor0 + texelColor1)*0.5f; +}
\ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/color_mix.fs b/examples/shaders/resources/shaders/glsl330/color_mix.fs new file mode 100644 index 00000000..bac8d576 --- /dev/null +++ b/examples/shaders/resources/shaders/glsl330/color_mix.fs @@ -0,0 +1,22 @@ +#version 330 + +// Input vertex attributes (from vertex shader) +in vec3 vertexPos; +in vec2 fragTexCoord; +in vec4 fragColor; + +// Input uniform values +uniform sampler2D texture0; +uniform sampler2D texture1; +uniform vec4 colDiffuse; + +out vec4 finalColor; + +void main() +{ + // Texel color fetching from texture sampler + vec4 texelColor0 = texture(texture0, fragTexCoord); + vec4 texelColor1 = texture(texture1, fragTexCoord); + + finalColor = (texelColor0 + texelColor1)*0.5f; +}
\ No newline at end of file |
