diff options
| author | Ray <[email protected]> | 2021-03-17 19:03:51 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-03-17 19:03:51 +0100 |
| commit | ff6d5c8ddbc3e49ee24a077086df5b2d6af52a5e (patch) | |
| tree | 59cf266498981f4ac84ac16967a15532e05e9c42 /examples/shaders/resources | |
| parent | aba69146f2eb4cb4bcd511f508cd702bfb81577b (diff) | |
| download | raylib-ff6d5c8ddbc3e49ee24a077086df5b2d6af52a5e.tar.gz raylib-ff6d5c8ddbc3e49ee24a077086df5b2d6af52a5e.zip | |
REVIEWED: shaders_multi_sample2d
Diffstat (limited to 'examples/shaders/resources')
| -rw-r--r-- | examples/shaders/resources/shaders/glsl100/color_mix.fs | 8 | ||||
| -rw-r--r-- | examples/shaders/resources/shaders/glsl330/color_mix.fs | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/examples/shaders/resources/shaders/glsl100/color_mix.fs b/examples/shaders/resources/shaders/glsl100/color_mix.fs index 0074e6af..c5c0cb70 100644 --- a/examples/shaders/resources/shaders/glsl100/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl100/color_mix.fs @@ -11,6 +11,8 @@ uniform sampler2D texture0; uniform sampler2D texture1; uniform vec4 colDiffuse; +uniform float divider; + void main() { // Texel color fetching from texture sampler @@ -18,7 +20,7 @@ void main() vec4 texelColor1 = texture2D(texture1, fragTexCoord); float x = fract(fragTexCoord.s); - float out = smoothstep(0.4, 0.6, x); + float final = smoothstep(divider - 0.1, divider + 0.1, x); - gl_FragColor = mix(texelColor0, texelColor1, out); -}
\ No newline at end of file + gl_FragColor = mix(texelColor0, texelColor1, final); +} diff --git a/examples/shaders/resources/shaders/glsl330/color_mix.fs b/examples/shaders/resources/shaders/glsl330/color_mix.fs index 1ac7520a..761b3464 100644 --- a/examples/shaders/resources/shaders/glsl330/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl330/color_mix.fs @@ -10,6 +10,8 @@ uniform sampler2D texture0; uniform sampler2D texture1; uniform vec4 colDiffuse; +uniform float divider = 0.5; + out vec4 finalColor; void main() @@ -19,7 +21,7 @@ void main() vec4 texelColor1 = texture(texture1, fragTexCoord); float x = fract(fragTexCoord.s); - float outVal = smoothstep(0.4, 0.6, x); + float final = smoothstep(divider - 0.1, divider + 0.1, x); - finalColor = mix(texelColor0, texelColor1, outVal); + finalColor = mix(texelColor0, texelColor1, final); }
\ No newline at end of file |
