diff options
| author | Ray <[email protected]> | 2023-01-01 18:31:03 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-01-01 18:31:03 +0100 |
| commit | 5ba41e4f7fc2af29c59705e2179e7333ff68b92f (patch) | |
| tree | 3ccab59b0580b351b29b3118457855480ccd18f5 /examples/shaders/resources | |
| parent | 3cfb9a6e83af9a94a2d1d57dd6bbfba738c09b2a (diff) | |
| download | raylib-5ba41e4f7fc2af29c59705e2179e7333ff68b92f.tar.gz raylib-5ba41e4f7fc2af29c59705e2179e7333ff68b92f.zip | |
REVIEWED: `shaders_write_depth` example
Diffstat (limited to 'examples/shaders/resources')
| -rw-r--r-- | examples/shaders/resources/shaders/glsl100/write_depth.fs | 4 | ||||
| -rw-r--r-- | examples/shaders/resources/shaders/glsl330/write_depth.fs | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/examples/shaders/resources/shaders/glsl100/write_depth.fs b/examples/shaders/resources/shaders/glsl100/write_depth.fs index 5167efb8..341c6115 100644 --- a/examples/shaders/resources/shaders/glsl100/write_depth.fs +++ b/examples/shaders/resources/shaders/glsl100/write_depth.fs @@ -7,9 +7,11 @@ varying vec4 fragColor; uniform sampler2D texture0; uniform vec4 colDiffuse; + void main() { vec4 texelColor = texture2D(texture0, fragTexCoord); + gl_FragColor = texelColor*colDiffuse*fragColor; - gl_FragDepthEXT = 1.0 - gl_FragCoord.z; + gl_FragDepthEXT = 1.0 - gl_FragCoord.z; }
\ No newline at end of file diff --git a/examples/shaders/resources/shaders/glsl330/write_depth.fs b/examples/shaders/resources/shaders/glsl330/write_depth.fs index 36c70fe4..88a4113f 100644 --- a/examples/shaders/resources/shaders/glsl330/write_depth.fs +++ b/examples/shaders/resources/shaders/glsl330/write_depth.fs @@ -5,9 +5,11 @@ in vec4 fragColor; uniform sampler2D texture0; uniform vec4 colDiffuse; + void main() { vec4 texelColor = texture2D(texture0, fragTexCoord); + gl_FragColor = texelColor*colDiffuse*fragColor; - gl_FragDepth = 1.0 - gl_FragCoord.z; -}
\ No newline at end of file + gl_FragDepth = 1.0 - gl_FragCoord.z; +} |
