Page MenuHome

Studio and Flat lightning in single color do not respect clipping region.
Closed, ResolvedPublic


System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-14 21:02, hash: rB65168825e0b0
Worked: (optional)

Event Timeline

Germano Cavalcante (mano-wii) triaged this task as Confirmed, Medium priority.

The condition in workbench_is_matdata_pass_enabled is preventing the clip_planes uniforms from being set.
Here's a solution:

diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 1473b7df279..91e824b047e 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -317,6 +317,10 @@ void workbench_material_shgroup_uniform(WORKBENCH_PrivateData *wpd,
                                         const bool deferred,
                                         const int interp)
+    DRW_shgroup_state_enable(grp, DRW_STATE_CLIP_PLANES);
+  }
   if (deferred && !workbench_is_matdata_pass_enabled(wpd)) {
@@ -345,10 +349,6 @@ void workbench_material_shgroup_uniform(WORKBENCH_PrivateData *wpd,
     DRW_shgroup_uniform_float(grp, "materialRoughness", &material->roughness, 1);
-    DRW_shgroup_state_enable(grp, DRW_STATE_CLIP_PLANES);
-  }
 void workbench_material_copy(WORKBENCH_MaterialData *dest_material,

@Germano Cavalcante (mano-wii) diff is fine by me! Perhaps add a comment that we set the clipping planes before a possible early exit. as normally we do this at the end
Please add it as a patch and add @Clément Foucault (fclem) as reviewer.


Germano Cavalcante (mano-wii) closed this task as Resolved.