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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-05-15 16:19:57 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-05-15 16:40:12 +0300
commit197af58baab1c1be7e6f371a829b31f5c1098a73 (patch)
tree34a454ee49cfa782178ff06095154599b3732002 /source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
parent4d5b7696cbf8b4452dbc04200cb7cd188373f19a (diff)
Workbench: Cleaner Shadow edges own shadow
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl')
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
index 54c5bce4271..2cc0ff3723d 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
@@ -4,22 +4,22 @@ uniform vec3 object_color = vec3(1.0, 0.0, 1.0);
uniform sampler2D image;
#endif
-#ifdef V3D_LIGHTING_STUDIO
+#ifdef NORMAL_VIEWPORT_PASS_ENABLED
in vec3 normal_viewport;
-#endif /* V3D_LIGHTING_STUDIO */
+#endif /* NORMAL_VIEWPORT_PASS_ENABLED */
#ifdef OB_TEXTURE
in vec2 uv_interp;
#endif /* OB_TEXTURE */
layout(location=0) out uint objectId;
layout(location=1) out vec4 diffuseColor;
-#ifdef V3D_LIGHTING_STUDIO
-#ifdef WORKBENCH_ENCODE_NORMALS
+#ifdef NORMAL_VIEWPORT_PASS_ENABLED
+ #ifdef WORKBENCH_ENCODE_NORMALS
layout(location=2) out vec2 normalViewport;
-#else /* WORKBENCH_ENCODE_NORMALS */
+ #else /* WORKBENCH_ENCODE_NORMALS */
layout(location=2) out vec3 normalViewport;
-#endif /* WORKBENCH_ENCODE_NORMALS */
-#endif /* V3D_LIGHTING_STUDIO */
+ #endif /* WORKBENCH_ENCODE_NORMALS */
+#endif /* NORMAL_VIEWPORT_PASS_ENABLED */
void main()
{
@@ -31,18 +31,18 @@ void main()
diffuseColor = texture(image, uv_interp);
#endif /* OB_TEXTURE */
-#ifdef V3D_LIGHTING_STUDIO
-#ifdef WORKBENCH_ENCODE_NORMALS
+#ifdef NORMAL_VIEWPORT_PASS_ENABLED
+ #ifdef WORKBENCH_ENCODE_NORMALS
if (!gl_FrontFacing) {
- normalViewport = normal_encode(-normal_viewport);
+ normalViewport = normal_encode(normalize(-normal_viewport));
diffuseColor.a = 1.0;
}
else {
- normalViewport = normal_encode(normal_viewport);
+ normalViewport = normal_encode(normalize(normal_viewport));
diffuseColor.a = 0.0;
}
-#else /* WORKBENCH_ENCODE_NORMALS */
+ #else /* WORKBENCH_ENCODE_NORMALS */
normalViewport = normal_viewport;
-#endif /* WORKBENCH_ENCODE_NORMALS */
-#endif /* V3D_LIGHTING_STUDIO */
+ #endif /* WORKBENCH_ENCODE_NORMALS */
+#endif /* NORMAL_VIEWPORT_PASS_ENABLED */
}