summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders/resources
diff options
context:
space:
mode:
authorRay <[email protected]>2020-10-29 20:22:52 +0100
committerRay <[email protected]>2020-10-29 20:22:52 +0100
commit8a1634813105906e84672d43101009e388ded407 (patch)
treea3179f044aa3d6343a1db1abf82b107647b7f6fa /examples/shaders/resources
parent60d874caf8ab32e57d4a356d1a15709cadd98de0 (diff)
downloadraylib-8a1634813105906e84672d43101009e388ded407.tar.gz
raylib-8a1634813105906e84672d43101009e388ded407.zip
Support multiple sample2D on batch drawing #1333
Diffstat (limited to 'examples/shaders/resources')
-rw-r--r--examples/shaders/resources/shaders/glsl100/color_mix.fs21
-rw-r--r--examples/shaders/resources/shaders/glsl330/color_mix.fs22
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