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:
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl b/source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl
index 30b3bdb890d..ffd52a0a225 100644
--- a/source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl
@@ -42,27 +42,27 @@ const vec4 invisible = vec4(0.0);
bool front(vec3 N)
{
- vec4 xformed = ModelViewMatrix * vec4(pos, 1.0);
- return dot(NormalMatrix * N, normalize(-xformed.xyz)) > 0.0;
+ vec4 xformed = ModelViewMatrix * vec4(pos, 1.0);
+ return dot(NormalMatrix * N, normalize(-xformed.xyz)) > 0.0;
}
void main()
{
- bool face_1_front = front(N1);
- bool face_2_front = front(N2);
-
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
-
- if (face_1_front && face_2_front) {
- // front-facing edge
- finalColor = drawFront ? frontColor : invisible;
- }
- else if (face_1_front || face_2_front) {
- // exactly one face is front-facing, silhouette edge
- finalColor = drawSilhouette ? silhouetteColor : invisible;
- }
- else {
- // back-facing edge
- finalColor = drawBack ? backColor : invisible;
- }
+ bool face_1_front = front(N1);
+ bool face_2_front = front(N2);
+
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+
+ if (face_1_front && face_2_front) {
+ // front-facing edge
+ finalColor = drawFront ? frontColor : invisible;
+ }
+ else if (face_1_front || face_2_front) {
+ // exactly one face is front-facing, silhouette edge
+ finalColor = drawSilhouette ? silhouetteColor : invisible;
+ }
+ else {
+ // back-facing edge
+ finalColor = drawBack ? backColor : invisible;
+ }
}