From 926cbd0d49890772f911e6a6bedb7835605ced89 Mon Sep 17 00:00:00 2001 From: pryazha Date: Thu, 6 Feb 2025 12:38:09 +0500 Subject: change --- advanced_opengl/1.depth/shaders/depth.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'advanced_opengl/1.depth/shaders/depth.fs') diff --git a/advanced_opengl/1.depth/shaders/depth.fs b/advanced_opengl/1.depth/shaders/depth.fs index 2f3d9ca..a515c15 100644 --- a/advanced_opengl/1.depth/shaders/depth.fs +++ b/advanced_opengl/1.depth/shaders/depth.fs @@ -6,14 +6,14 @@ in vec2 tex_coords; uniform sampler2D our_texture; -float near = 0.1f; -float far = 100.0f; +float near = 0.1; +float far = 100.0; float linearize_depth(float depth) { - float ndc_z = 2.0f*depth-1.0f; - return((2.0f*near*far)/(far+near-ndc_z*(far-near))); + float ndc_z = 2.0*depth-1.0; + return((2.0*near*far)/(far+near-ndc_z*(far-near))); } void @@ -23,5 +23,5 @@ main(void) frag_color = texture(our_texture, tex_coords); */ float depth = linearize_depth(gl_FragCoord.z)/far; - frag_color = vec4(vec3(depth), 1.0f); + frag_color = vec4(vec3(depth), 1.0); } -- cgit v1.2.3