summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders/shaders_multi_sample2d.data
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-10-17 21:02:18 +0200
committerraysan5 <[email protected]>2021-10-17 21:02:18 +0200
commit35e67da08e3d214589968c19b4b2fb31d8e566cc (patch)
tree5054bcea5f6df754f467590101789b17dd9d9944 /examples/shaders/shaders_multi_sample2d.data
parentb2228039039afc05c41edd12103123f2a36c8080 (diff)
downloadraylib.com-35e67da08e3d214589968c19b4b2fb31d8e566cc.tar.gz
raylib.com-35e67da08e3d214589968c19b4b2fb31d8e566cc.zip
UPDATED: examples to raylib 4.0
Some new examples added
Diffstat (limited to 'examples/shaders/shaders_multi_sample2d.data')
-rw-r--r--examples/shaders/shaders_multi_sample2d.data26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/shaders/shaders_multi_sample2d.data b/examples/shaders/shaders_multi_sample2d.data
new file mode 100644
index 0000000..c5c0cb7
--- /dev/null
+++ b/examples/shaders/shaders_multi_sample2d.data
@@ -0,0 +1,26 @@
+#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;
+
+uniform float divider;
+
+void main()
+{
+ // Texel color fetching from texture sampler
+ vec4 texelColor0 = texture2D(texture0, fragTexCoord);
+ vec4 texelColor1 = texture2D(texture1, fragTexCoord);
+
+ float x = fract(fragTexCoord.s);
+ float final = smoothstep(divider - 0.1, divider + 0.1, x);
+
+ gl_FragColor = mix(texelColor0, texelColor1, final);
+}