From 9be8a945459566a320bcd8ff1e687ebf322b1820 Mon Sep 17 00:00:00 2001 From: Martin Siggel Date: Tue, 7 Nov 2023 15:46:05 +0100 Subject: [PATCH] Improved visual quality of zebra stripes The stripes were computed based on the normal vector of the vertex, not on the fragment. This lead to visual distortions. Now, we use the normal vector from the fragment shader as offered by the occt api. --- TIGLViewer/shaders/PhongShading-v7.6.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TIGLViewer/shaders/PhongShading-v7.6.fs b/TIGLViewer/shaders/PhongShading-v7.6.fs index d02cb75a2..25efa8b73 100644 --- a/TIGLViewer/shaders/PhongShading-v7.6.fs +++ b/TIGLViewer/shaders/PhongShading-v7.6.fs @@ -180,7 +180,7 @@ vec4 computeLighting (in vec3 theNormal, vec3 v = vec3(0., 0., -1.); // Direction of the view reflected on the surface - vec3 vReflect = 2. * (dot(Normal, v)*Normal - v); + vec3 vReflect = 2. * (dot(theNormal, v)*theNormal - v); // normal vector of the light stripe plane vec3 lightDir = normalize(vec3(0., 1., 0.));