We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d64598 commit 54ccb18Copy full SHA for 54ccb18
1 file changed
examples/shaders/resources/shaders/glsl330/write_depth.fs
@@ -1,15 +1,20 @@
1
#version 330
2
3
+// Input vertex attributes (from vertex shader)
4
in vec2 fragTexCoord;
5
in vec4 fragColor;
6
7
+// Input uniform values
8
uniform sampler2D texture0;
9
uniform vec4 colDiffuse;
10
11
+// Output fragment color
12
+out vec4 finalColor;
13
+
14
void main()
15
{
- vec4 texelColor = texture2D(texture0, fragTexCoord);
16
+ vec4 texelColor = texture(texture0, fragTexCoord);
17
- gl_FragColor = texelColor*colDiffuse*fragColor;
- gl_FragDepth = 1.0 - gl_FragCoord.z;
18
+ finalColor = texelColor*colDiffuse*fragColor;
19
+ gl_FragDepth = 1.0 - finalColor.z;
20
}
0 commit comments