[Bf-blender-cvs] [b8e7991811d] blender2.8: Overlay: face orientation

Jeroen Bakker noreply at git.blender.org
Sun Apr 22 12:58:54 CEST 2018


Commit: b8e7991811dcf6fa698077f850fef17be83d2abb
Author: Jeroen Bakker
Date:   Sun Apr 22 12:58:11 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb8e7991811dcf6fa698077f850fef17be83d2abb

Overlay: face orientation

- fixed the blending with solid drawtype

===================================================================

M	source/blender/draw/modes/overlay_mode.c
M	source/blender/draw/modes/shaders/overlay_face_orientation_frag.glsl

===================================================================

diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c
index 7538899debc..e4a137b06f3 100644
--- a/source/blender/draw/modes/overlay_mode.c
+++ b/source/blender/draw/modes/overlay_mode.c
@@ -94,16 +94,8 @@ static void overlay_cache_init(void *vedata)
 	}
 
 	View3D *v3d = DCS->v3d;
-	int bm_face_orientation = DRW_STATE_ADDITIVE;
 	if (v3d) {
 		stl->g_data->overlays = v3d->overlays;
-
-		/*
-		    Solid flat/studio lighting gives strange results when blending with the defaults.
-		*/
-		if (v3d->drawtype == OB_SOLID) {
-			bm_face_orientation = DRW_STATE_BLEND;
-		}
 	}
 	else {
 		stl->g_data->overlays = 0;
@@ -111,7 +103,7 @@ static void overlay_cache_init(void *vedata)
 
 	/* Face Orientation Pass */
 	if (stl->g_data->overlays & V3D_OVERLAY_FACE_ORIENTATION) {
-		int state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | bm_face_orientation;
+		int state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_BLEND;
 		psl->face_orientation_pass = DRW_pass_create("Face Orientation", state);
 		stl->g_data->face_orientation_shgrp = DRW_shgroup_create(e_data.face_orientation_sh, psl->face_orientation_pass);
 	}
diff --git a/source/blender/draw/modes/shaders/overlay_face_orientation_frag.glsl b/source/blender/draw/modes/shaders/overlay_face_orientation_frag.glsl
index 21ed07683f0..5b0ad7863d1 100644
--- a/source/blender/draw/modes/shaders/overlay_face_orientation_frag.glsl
+++ b/source/blender/draw/modes/shaders/overlay_face_orientation_frag.glsl
@@ -6,5 +6,5 @@ out vec4 fragColor;
 
 void main()
 {
-	fragColor = vec4(gl_FrontFacing ? color_towards: color_outwards, 1.0);
+	fragColor = vec4(gl_FrontFacing ? color_towards: color_outwards, 0.7);
 }



More information about the Bf-blender-cvs mailing list