From 8a1634813105906e84672d43101009e388ded407 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 29 Oct 2020 20:22:52 +0100 Subject: Support multiple sample2D on batch drawing #1333 --- .../shaders/resources/shaders/glsl100/color_mix.fs | 21 +++++++++++++++++++++ .../shaders/resources/shaders/glsl330/color_mix.fs | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 examples/shaders/resources/shaders/glsl100/color_mix.fs create mode 100644 examples/shaders/resources/shaders/glsl330/color_mix.fs (limited to 'examples/shaders/resources') 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 -- cgit v1.2.3