Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-07-07 16:09:03 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-07 16:10:09 +0300
commite960cecdf8d1cef32f8c42e633ad05a08a97972b (patch)
tree9e4d556b9456fa413320b1b14f8904e09b567128 /source/blender/gpu
parent15f5457502ad7878d12f1368276cfa236914abf8 (diff)
GPU: Silence warning of potentially unused variable (NormalMatrix)
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl
index 94cd960872a..fa30c9fb1ed 100644
--- a/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_instance_edges_variying_color_vert.glsl
@@ -26,9 +26,7 @@ out vec3 fCol;
// TODO: in float angle; // [-pi .. +pi], + peak, 0 flat, - valley
-mat3 NormalMatrix;
-
-bool front(vec3 N, vec3 eye)
+bool front(mat3 NormalMatrix, vec3 N, vec3 eye)
{
return dot(NormalMatrix * N, eye) > 0.0;
}
@@ -41,7 +39,7 @@ void main()
MV_pos = ModelViewMatrix * vec4(pos, 1.0);
- NormalMatrix = transpose(inverse(mat3(ModelViewMatrix)));
+ mat3 NormalMatrix = transpose(inverse(mat3(ModelViewMatrix)));
/* if persp */
if (ProjectionMatrix[3][3] == 0.0) {
@@ -51,8 +49,8 @@ void main()
eye = vec3(0.0, 0.0, 1.0);
}
- bool face_1_front = front(N1, eye);
- bool face_2_front = front(N2, eye);
+ bool face_1_front = front(NormalMatrix, N1, eye);
+ bool face_2_front = front(NormalMatrix, N2, eye);
if (face_1_front && face_2_front)
edgeClass = 1.0; // front-facing edge