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>2019-03-19 17:41:14 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-03-19 17:43:49 +0300
commite226460dd35b1439092888f280b00e7993d78f13 (patch)
tree8645c94e5980c145bf156edfaf35a3aded0632af /source/blender/draw/engines/workbench/workbench_materials.c
parent9b8eef9d9c4a337bcdb9127bec63513dd0ee7e54 (diff)
Workbench: World Clipping For Specular Transparent
When Specular Transparent materials are used the world clipping did not work on the transparent materials. The reason was that the accum shaders did not vary on the existance of the clipping planes This patch will variate the accum shaders when clipping planes are active. Reviewed By: fclem Maniphest Tasks: T61023
Diffstat (limited to 'source/blender/draw/engines/workbench/workbench_materials.c')
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 47895f8729b..0bca8541e80 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -130,7 +130,7 @@ char *workbench_material_build_defines(WORKBENCH_PrivateData *wpd, bool use_text
if (is_hair) {
BLI_dynstr_appendf(ds, "#define HAIR_SHADER\n");
}
- if (wpd->world_clip_planes != NULL) {
+ if (WORLD_CLIPPING_ENABLED(wpd)) {
BLI_dynstr_appendf(ds, "#define USE_WORLD_CLIP_PLANES\n");
}
@@ -192,7 +192,7 @@ int workbench_material_get_prepass_shader_index(
SET_FLAG_FROM_TEST(index, NORMAL_VIEWPORT_PASS_ENABLED(wpd), 1 << 3);
SET_FLAG_FROM_TEST(index, MATCAP_ENABLED(wpd), 1 << 4);
SET_FLAG_FROM_TEST(index, use_textures, 1 << 5);
- SET_FLAG_FROM_TEST(index, wpd->world_clip_planes != NULL, 1 << 6);
+ SET_FLAG_FROM_TEST(index, WORLD_CLIPPING_ENABLED(wpd), 1 << 6);
BLI_assert(index < MAX_PREPASS_SHADERS);
return index;
}
@@ -207,6 +207,7 @@ int workbench_material_get_accum_shader_index(WORKBENCH_PrivateData *wpd, bool u
SET_FLAG_FROM_TEST(index, is_hair, 1 << 3);
/* 1 bits SHADOWS (only facing factor) */
SET_FLAG_FROM_TEST(index, SHADOW_ENABLED(wpd), 1 << 4);
+ SET_FLAG_FROM_TEST(index, WORLD_CLIPPING_ENABLED(wpd), 1 << 5);
BLI_assert(index < MAX_ACCUM_SHADERS);
return index;
}
@@ -281,7 +282,7 @@ void workbench_material_shgroup_uniform(
DRW_shgroup_uniform_float(grp, "materialRoughness", &material->roughness, 1);
}
- if (wpd->world_clip_planes != NULL) {
+ if (WORLD_CLIPPING_ENABLED(wpd)) {
DRW_shgroup_uniform_vec4(grp, "WorldClipPlanes", wpd->world_clip_planes[0], 6);
DRW_shgroup_state_enable(grp, DRW_STATE_CLIP_PLANES);
}