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:
authormano-wii <germano.costa@ig.com.br>2019-07-17 14:51:01 +0300
committermano-wii <germano.costa@ig.com.br>2019-07-17 14:51:57 +0300
commit11741ff682f84357a6bb58ade2f31628f3a8d517 (patch)
tree923b6e08a9668275d74aad17f6e8de193c70c72a
parent526272bf7ca060f8a7a48fe722a027c8035982cf (diff)
Fix T67001: Studio and Flat lightning in single color do not respect clipping region
`DRW_STATE_CLIP_PLANES` has to be enabled independent of the workbench material. Reviewers: fclem, jbakker Differential Revision: https://developer.blender.org/D5278
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 1473b7df279..6699a1954ba 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -317,33 +317,31 @@ void workbench_material_shgroup_uniform(WORKBENCH_PrivateData *wpd,
const bool deferred,
const int interp)
{
- if (deferred && !workbench_is_matdata_pass_enabled(wpd)) {
- return;
- }
-
- if (workbench_material_determine_color_type(wpd, material->ima, ob, false) ==
- V3D_SHADING_TEXTURE_COLOR) {
- GPUTexture *tex = GPU_texture_from_blender(material->ima, material->iuser, GL_TEXTURE_2D);
- DRW_shgroup_uniform_texture(grp, "image", tex);
- DRW_shgroup_uniform_bool_copy(
- grp, "imagePremultiplied", (material->ima->alpha_mode == IMA_ALPHA_PREMUL));
- DRW_shgroup_uniform_bool_copy(grp, "imageNearest", (interp == SHD_INTERP_CLOSEST));
- }
- else {
- DRW_shgroup_uniform_vec3(grp,
- "materialDiffuseColor",
- (use_metallic) ? material->base_color : material->diffuse_color,
- 1);
- }
-
- if (SPECULAR_HIGHLIGHT_ENABLED(wpd)) {
- if (use_metallic) {
- DRW_shgroup_uniform_float(grp, "materialMetallic", &material->metallic, 1);
+ if (!deferred || workbench_is_matdata_pass_enabled(wpd)) {
+ if (workbench_material_determine_color_type(wpd, material->ima, ob, false) ==
+ V3D_SHADING_TEXTURE_COLOR) {
+ GPUTexture *tex = GPU_texture_from_blender(material->ima, material->iuser, GL_TEXTURE_2D);
+ DRW_shgroup_uniform_texture(grp, "image", tex);
+ DRW_shgroup_uniform_bool_copy(
+ grp, "imagePremultiplied", (material->ima->alpha_mode == IMA_ALPHA_PREMUL));
+ DRW_shgroup_uniform_bool_copy(grp, "imageNearest", (interp == SHD_INTERP_CLOSEST));
}
else {
- DRW_shgroup_uniform_vec3(grp, "materialSpecularColor", material->specular_color, 1);
+ DRW_shgroup_uniform_vec3(grp,
+ "materialDiffuseColor",
+ (use_metallic) ? material->base_color : material->diffuse_color,
+ 1);
+ }
+
+ if (SPECULAR_HIGHLIGHT_ENABLED(wpd)) {
+ if (use_metallic) {
+ DRW_shgroup_uniform_float(grp, "materialMetallic", &material->metallic, 1);
+ }
+ else {
+ DRW_shgroup_uniform_vec3(grp, "materialSpecularColor", material->specular_color, 1);
+ }
+ DRW_shgroup_uniform_float(grp, "materialRoughness", &material->roughness, 1);
}
- DRW_shgroup_uniform_float(grp, "materialRoughness", &material->roughness, 1);
}
if (WORLD_CLIPPING_ENABLED(wpd)) {