Fix #118634: EEVEE: Set clip threshold per material

Pull Request: https://projects.blender.org/blender/blender/pulls/118681
This commit is contained in:
Miguel Pozo
2024-02-26 12:49:29 +01:00
parent e938b516a9
commit a106ff9f56

View File

@@ -526,6 +526,8 @@ BLI_INLINE void material_shadow(EEVEE_Data *vedata,
/* This GPUShader has already been used by another material.
* Add new shading group just after to avoid shader switching cost. */
grp = DRW_shgroup_create_sub(*grp_p);
/* Per material uniforms. */
DRW_shgroup_uniform_float_copy(grp, "alphaClipThreshold", alpha_clip_threshold);
}
else {
*grp_p = grp = DRW_shgroup_create(sh, psl->shadow_pass);
@@ -606,6 +608,8 @@ static EeveeMaterialCache material_opaque(EEVEE_Data *vedata,
/* This GPUShader has already been used by another material.
* Add new shading group just after to avoid shader switching cost. */
grp = DRW_shgroup_create_sub(*grp_p);
/* Per material uniforms. */
DRW_shgroup_uniform_float_copy(grp, "alphaClipThreshold", alpha_clip_threshold);
}
else {
*grp_p = grp = DRW_shgroup_create(sh, depth_ps);
@@ -653,6 +657,7 @@ static EeveeMaterialCache material_opaque(EEVEE_Data *vedata,
grp = DRW_shgroup_create_sub(*grp_p);
/* Per material uniforms. */
DRW_shgroup_uniform_float_copy(grp, "alphaClipThreshold", alpha_clip_threshold);
if (use_ssrefract) {
DRW_shgroup_uniform_float_copy(grp, "refractionDepth", ma->refract_depth);
}