Commit: 15862e199087dec07b784d9af7aa23cdbbdcaff2
Author: Clément Foucault
Date:   Sun Jun 10 15:46:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB15862e199087dec07b784d9af7aa23cdbbdcaff2

Workbench: Xray: Lower hairs opacity

Since hairs are very likely to owerflow the weight buffer, we divide their
alpha value by 3.

This might become a particle system setting if needed.

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

M       source/blender/draw/engines/workbench/workbench_forward.c

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

diff --git a/source/blender/draw/engines/workbench/workbench_forward.c 
b/source/blender/draw/engines/workbench/workbench_forward.c
index 8d67a936382..fb949cd02c9 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -420,7 +420,10 @@ static void 
workbench_forward_cache_populate_particles(WORKBENCH_Data *vedata, O
                        workbench_material_set_normal_world_matrix(shgrp, wpd, 
e_data.normal_world_matrix);
                        DRW_shgroup_uniform_block(shgrp, "world_block", 
wpd->world_ubo);
                        DRW_shgroup_uniform_block(shgrp, "material_block", 
material->material_ubo);
-                       DRW_shgroup_uniform_float(shgrp, "alpha", 
&wpd->shading.xray_alpha, 1);
+                       /* Hairs have lots of layer and can rapidly become the 
most prominent surface.
+                        * So lower their alpha artificially. */
+                       float hair_alpha = wpd->shading.xray_alpha * 0.33f;
+                       DRW_shgroup_uniform_float_copy(shgrp, "alpha", 
hair_alpha);
                        if (image) {
                                GPUTexture *tex = 
GPU_texture_from_blender(image, NULL, GL_TEXTURE_2D, false, false, false);
                                DRW_shgroup_uniform_texture(shgrp, "image", 
tex);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to