diff options
| author | Ray <[email protected]> | 2020-11-01 13:39:48 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2020-11-01 13:39:48 +0100 |
| commit | 8e15dae5ed8264565d3f94aeac7a663ce76a2e62 (patch) | |
| tree | 299a73e64ef3240746353b2353c73b284400c748 /examples/shaders/resources | |
| parent | 5f79ad9765f1d01e72b84b257911ae8dd4dbc232 (diff) | |
| download | raylib-8e15dae5ed8264565d3f94aeac7a663ce76a2e62.tar.gz raylib-8e15dae5ed8264565d3f94aeac7a663ce76a2e62.zip | |
Review contributed examples
Diffstat (limited to 'examples/shaders/resources')
| -rw-r--r-- | examples/shaders/resources/shaders/glsl100/color_mix.fs | 7 | ||||
| -rw-r--r-- | examples/shaders/resources/shaders/glsl330/color_mix.fs | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/examples/shaders/resources/shaders/glsl100/color_mix.fs b/examples/shaders/resources/shaders/glsl100/color_mix.fs index f6ab7dcd..0074e6af 100644 --- a/examples/shaders/resources/shaders/glsl100/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl100/color_mix.fs @@ -16,6 +16,9 @@ void main() // Texel color fetching from texture sampler vec4 texelColor0 = texture2D(texture0, fragTexCoord); vec4 texelColor1 = texture2D(texture1, fragTexCoord); - - gl_FragColor = (texelColor0 + texelColor1)*0.5f; + + 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 diff --git a/examples/shaders/resources/shaders/glsl330/color_mix.fs b/examples/shaders/resources/shaders/glsl330/color_mix.fs index bac8d576..11515b0c 100644 --- a/examples/shaders/resources/shaders/glsl330/color_mix.fs +++ b/examples/shaders/resources/shaders/glsl330/color_mix.fs @@ -18,5 +18,8 @@ void main() vec4 texelColor0 = texture(texture0, fragTexCoord); vec4 texelColor1 = texture(texture1, fragTexCoord); - finalColor = (texelColor0 + texelColor1)*0.5f; + float x = fract(fragTexCoord.s); + float out = smoothstep(0.4, 0.6, x); + + finalColor = mix(texelColor0, texelColor1, out); }
\ No newline at end of file |
