diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-15 13:03:26 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-15 13:03:49 +0300 |
commit | 0819013eb45532e2ac26c725d09a4c74478e85d7 (patch) | |
tree | 008428ac7ef93d078bbdea1c7319aa0ba0387fc2 /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | cf1a945e5ad570e9ae159b569a2a3cfc11874f98 (diff) |
Eevee: Add per material option to cull backfaces
This is in order to have more flexibility and to have an explicit option
for final renders.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 3f6cc306c97..c6b228c29d3 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1208,7 +1208,6 @@ static void material_opaque(Material *ma, GHash *material_hash, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, - bool do_cull, struct GPUMaterial **gpumat, struct GPUMaterial **gpumat_depth, struct DRWShadingGroup **shgrp, @@ -1228,6 +1227,7 @@ static void material_opaque(Material *ma, float *spec_p = &ma->spec; float *rough_p = &ma->roughness; + const bool do_cull = (ma->blend_flag & MA_BL_CULL_BACKFACE) != 0; 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); @@ -1460,7 +1460,6 @@ static void material_opaque(Material *ma, static void material_transparent(Material *ma, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, - bool do_cull, struct GPUMaterial **gpumat, struct DRWShadingGroup **shgrp, struct DRWShadingGroup **shgrp_depth) @@ -1471,6 +1470,7 @@ static void material_transparent(Material *ma, EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl; EEVEE_LightsInfo *linfo = sldata->lights; + const bool do_cull = (ma->blend_flag & MA_BL_CULL_BACKFACE) != 0; const bool use_ssrefract = (((ma->blend_flag & MA_BL_SS_REFRACTION) != 0) && ((stl->effects->enabled_effects & EFFECT_REFRACT) != 0)); float *color_p = &ma->r; @@ -1604,8 +1604,6 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, Scene *scene = draw_ctx->scene; GHash *material_hash = stl->g_data->material_hash; - const bool do_cull = (draw_ctx->v3d && - (draw_ctx->v3d->shading.flag & V3D_SHADING_BACKFACE_CULLING)); bool is_sculpt_mode = DRW_object_use_pbvh_drawing(ob); /* For now just force fully shaded with eevee when supported. */ is_sculpt_mode = is_sculpt_mode && @@ -1641,7 +1639,6 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, material_hash, sldata, vedata, - do_cull, &gpumat_array[i], &gpumat_depth_array[i], &shgrp_array[i], @@ -1654,7 +1651,6 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, material_transparent(ma_array[i], sldata, vedata, - do_cull, &gpumat_array[i], &shgrp_array[i], &shgrp_depth_array[i]); |