mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-24 16:19:18 -05:00
[example] Writing into the depth buffer (#2836)
* Add a depth buffer example. * Fixed a typo
This commit is contained in:
committed by
GitHub
parent
30b75702df
commit
3cfb9a6e83
13
examples/shaders/resources/shaders/glsl330/write_depth.fs
Normal file
13
examples/shaders/resources/shaders/glsl330/write_depth.fs
Normal file
@ -0,0 +1,13 @@
|
||||
#version 330
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user