Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_subsurface.c
| Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | if ((effects->enabled_effects & EFFECT_SSS) != 0) { | ||||
| else { | else { | ||||
| /* Copy stencil channel, could be avoided (see EEVEE_subsurface_init) */ | /* Copy stencil channel, could be avoided (see EEVEE_subsurface_init) */ | ||||
| GPU_framebuffer_blit(fbl->main_fb, 0, fbl->sss_blur_fb, 0, GPU_STENCIL_BIT); | GPU_framebuffer_blit(fbl->main_fb, 0, fbl->sss_blur_fb, 0, GPU_STENCIL_BIT); | ||||
| } | } | ||||
| if (!DRW_pass_is_empty(psl->sss_translucency_ps)) { | if (!DRW_pass_is_empty(psl->sss_translucency_ps)) { | ||||
| /* We sample the shadow-maps using normal sampler. We need to disable Comparison mode. | /* We sample the shadow-maps using normal sampler. We need to disable Comparison mode. | ||||
| * TODO(fclem) avoid this by using sampler objects.*/ | * TODO(fclem) avoid this by using sampler objects.*/ | ||||
| GPU_texture_bind(sldata->shadow_cube_pool, 0); | |||||
| GPU_texture_compare_mode(sldata->shadow_cube_pool, false); | GPU_texture_compare_mode(sldata->shadow_cube_pool, false); | ||||
| GPU_texture_unbind(sldata->shadow_cube_pool); | |||||
| GPU_texture_bind(sldata->shadow_cascade_pool, 0); | |||||
| GPU_texture_compare_mode(sldata->shadow_cascade_pool, false); | GPU_texture_compare_mode(sldata->shadow_cascade_pool, false); | ||||
| GPU_texture_unbind(sldata->shadow_cascade_pool); | |||||
| GPU_framebuffer_bind(fbl->sss_translucency_fb); | GPU_framebuffer_bind(fbl->sss_translucency_fb); | ||||
| DRW_draw_pass(psl->sss_translucency_ps); | DRW_draw_pass(psl->sss_translucency_ps); | ||||
| /* Reset original state. */ | /* Reset original state. */ | ||||
| GPU_texture_bind(sldata->shadow_cube_pool, 0); | |||||
| GPU_texture_compare_mode(sldata->shadow_cube_pool, true); | GPU_texture_compare_mode(sldata->shadow_cube_pool, true); | ||||
| GPU_texture_unbind(sldata->shadow_cube_pool); | |||||
| GPU_texture_bind(sldata->shadow_cascade_pool, 0); | |||||
| GPU_texture_compare_mode(sldata->shadow_cascade_pool, true); | GPU_texture_compare_mode(sldata->shadow_cascade_pool, true); | ||||
| GPU_texture_unbind(sldata->shadow_cascade_pool); | |||||
| } | } | ||||
| /* 1. horizontal pass */ | /* 1. horizontal pass */ | ||||
| GPU_framebuffer_bind(fbl->sss_blur_fb); | GPU_framebuffer_bind(fbl->sss_blur_fb); | ||||
| GPU_framebuffer_clear_color(fbl->sss_blur_fb, clear); | GPU_framebuffer_clear_color(fbl->sss_blur_fb, clear); | ||||
| DRW_draw_pass(psl->sss_blur_ps); | DRW_draw_pass(psl->sss_blur_ps); | ||||
| /* 2. vertical pass + Resolve */ | /* 2. vertical pass + Resolve */ | ||||
| Show All 35 Lines | |||||