[Bf-blender-cvs] [b8fc6317c76] blender2.8: Eevee: Remove per material SSS toggle

Clément Foucault noreply at git.blender.org
Wed Aug 8 21:38:01 CEST 2018


Commit: b8fc6317c765ef28a5cd359b3192280c8a69c301
Author: Clément Foucault
Date:   Wed Aug 8 20:14:42 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb8fc6317c765ef28a5cd359b3192280c8a69c301

Eevee: Remove per material SSS toggle

This is because we can now optimize the use of SSS on shaders based on
socket input values.

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

M	release/scripts/startup/bl_ui/properties_material.py
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/makesdna/DNA_material_types.h
M	source/blender/makesrna/intern/rna_material.c

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

diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 5d12f762073..706ce497dee 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -212,11 +212,7 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
 
         layout.prop(mat, "use_screen_refraction")
         layout.prop(mat, "refraction_depth")
-
-        layout.prop(mat, "use_screen_subsurface")
-        row = layout.row()
-        row.active = mat.use_screen_subsurface
-        row.prop(mat, "use_sss_translucency")
+        layout.prop(mat, "use_sss_translucency")
 
 
 class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index cd6b5db5b56..9ef64477aca 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -404,7 +404,6 @@ static void add_standard_uniforms(
 		DRW_shgroup_uniform_texture_ref(shgrp, "probePlanars", &vedata->txl->planar_pool);
 		DRW_shgroup_uniform_int(shgrp, "outputSsrId", ssr_id, 1);
 	}
-
 	if (use_refract || use_ssrefraction) {
 		BLI_assert(refract_depth != NULL);
 		DRW_shgroup_uniform_float(shgrp, "refractionDepth", refract_depth, 1);
@@ -1128,8 +1127,7 @@ static void material_opaque(
 	const bool use_gpumat = (ma->use_nodes && ma->nodetree);
 	const bool use_ssrefract = ((ma->blend_flag & MA_BL_SS_REFRACTION) != 0) &&
 	                         ((effects->enabled_effects & EFFECT_REFRACT) != 0);
-	const bool use_sss = ((ma->blend_flag & MA_BL_SS_SUBSURFACE) != 0) &&
-	                     ((effects->enabled_effects & EFFECT_SSS) != 0);
+	bool use_sss = ((effects->enabled_effects & EFFECT_SSS) != 0);
 	const bool use_translucency = use_sss && ((ma->blend_flag & MA_BL_TRANSLUCENCY) != 0);
 
 	EeveeMaterialShadingGroups *emsg = BLI_ghash_lookup(material_hash, (const void *)ma);
@@ -1213,6 +1211,7 @@ static void material_opaque(
 				use_diffuse = GPU_material_flag_get(*gpumat, GPU_MATFLAG_DIFFUSE);
 				use_glossy = GPU_material_flag_get(*gpumat, GPU_MATFLAG_GLOSSY);
 				use_refract = GPU_material_flag_get(*gpumat, GPU_MATFLAG_REFRACT);
+				use_sss = use_sss && GPU_material_flag_get(*gpumat, GPU_MATFLAG_SSS);
 
 				*shgrp = DRW_shgroup_material_create(
 				        *gpumat,
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 50d9b890724..9d4da91aaed 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -273,7 +273,7 @@ enum {
 enum {
 	MA_BL_HIDE_BACKSIDE =        (1 << 0),
 	MA_BL_SS_REFRACTION =        (1 << 1),
-	MA_BL_SS_SUBSURFACE =        (1 << 2),
+	MA_BL_SS_SUBSURFACE =        (1 << 2), /* DEPRECATED */
 	MA_BL_TRANSLUCENCY =         (1 << 3),
 };
 
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index b6250a81b3b..44d14975ab0 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -688,11 +688,6 @@ void RNA_def_material(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Screen Space Refraction", "Use raytraced screen space refractions");
 	RNA_def_property_update(prop, 0, "rna_Material_draw_update");
 
-	prop = RNA_def_property(srna, "use_screen_subsurface", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_SS_SUBSURFACE);
-	RNA_def_property_ui_text(prop, "Screen Space Subsurface Scattering", "Use post process subsurface scattering");
-	RNA_def_property_update(prop, 0, "rna_Material_draw_update");
-
 	prop = RNA_def_property(srna, "use_sss_translucency", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_TRANSLUCENCY);
 	RNA_def_property_ui_text(prop, "Subsurface Translucency", "Add translucency effect to subsurface");



More information about the Bf-blender-cvs mailing list