use texelfetch instead of texturelod

This commit is contained in:
Squall-Leonhart 2023-10-16 04:20:45 +11:00
parent 81627a6a51
commit 9e0b778d11
2 changed files with 2 additions and 2 deletions

View file

@ -9,6 +9,6 @@ layout(location = 0) out vec4 color;
void main() { void main() {
ivec2 coord = ivec2(gl_FragCoord.xy); ivec2 coord = ivec2(gl_FragCoord.xy);
float depth = textureLod(depth_tex, coord, 0).r; float depth = texelFetch(depth_tex, coord, 0).r;
color = vec4(depth, depth, depth, 1.0); color = vec4(depth, depth, depth, 1.0);
} }

View file

@ -9,7 +9,7 @@ layout(location = 0) out vec4 color;
void main() { void main() {
ivec2 coord = ivec2(gl_FragCoord.xy); ivec2 coord = ivec2(gl_FragCoord.xy);
float depth = textureLod(depth_tex, coord, 0).r; float depth = texelFetch(depth_tex, coord, 0).r;
color = vec4(depth, depth, depth, 1.0); color = vec4(depth, depth, depth, 1.0);
color = color.bgra; // Swap color channels for BGRA format color = color.bgra; // Swap color channels for BGRA format
} }