summaryrefslogtreecommitdiffhomepage
path: root/examples/web/shaders/shaders_multi_sample2d.data
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-12-24 13:26:30 +0100
committerraysan5 <[email protected]>2020-12-24 13:26:30 +0100
commit83ab2cb01746a869b625c9d84fbb4737146b73a9 (patch)
tree010b0794848d863916e5acb4f766ea9e7ecb6e90 /examples/web/shaders/shaders_multi_sample2d.data
parentd11274dcfcb0f349fba16ab4b83d2b96bcac8d1a (diff)
downloadraylib.com-83ab2cb01746a869b625c9d84fbb4737146b73a9.tar.gz
raylib.com-83ab2cb01746a869b625c9d84fbb4737146b73a9.zip
Updated Web examples to raylib 3.5
Diffstat (limited to 'examples/web/shaders/shaders_multi_sample2d.data')
-rw-r--r--examples/web/shaders/shaders_multi_sample2d.data24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/web/shaders/shaders_multi_sample2d.data b/examples/web/shaders/shaders_multi_sample2d.data
new file mode 100644
index 0000000..0074e6a
--- /dev/null
+++ b/examples/web/shaders/shaders_multi_sample2d.data
@@ -0,0 +1,24 @@
+#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);
+
+ float x = fract(fragTexCoord.s);
+ float out = smoothstep(0.4, 0.6, x);
+
+ gl_FragColor = mix(texelColor0, texelColor1, out);
+} \ No newline at end of file