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:
authorClément Foucault <foucault.clem@gmail.com>2018-08-08 21:14:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-08-08 22:27:33 +0300
commitb8fc6317c765ef28a5cd359b3192280c8a69c301 (patch)
tree66a00b7dd4915c24a2143d90940f4f14903ac4b6 /source/blender
parentcac43e1765ab128880bd410d3b8387dc7143f740 (diff)
Eevee: Remove per material SSS toggle
This is because we can now optimize the use of SSS on shaders based on socket input values.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c5
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_material.c5
3 files changed, 3 insertions, 9 deletions
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");