Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_screen_raytrace.c
| Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void EEVEE_reflection_output_init(EEVEE_ViewLayerData *UNUSED(sldata), | void EEVEE_reflection_output_init(EEVEE_ViewLayerData *UNUSED(sldata), | ||||
| EEVEE_Data *vedata, | EEVEE_Data *vedata, | ||||
| uint tot_samples) | uint tot_samples) | ||||
| { | { | ||||
| EEVEE_FramebufferList *fbl = vedata->fbl; | EEVEE_FramebufferList *fbl = vedata->fbl; | ||||
| EEVEE_TextureList *txl = vedata->txl; | EEVEE_TextureList *txl = vedata->txl; | ||||
| EEVEE_StorageList *stl = vedata->stl; | |||||
| EEVEE_EffectsInfo *effects = stl->effects; | |||||
| const float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f}; | |||||
| /* Create FrameBuffer. */ | /* Create FrameBuffer. */ | ||||
| const eGPUTextureFormat texture_format = (tot_samples > 256) ? GPU_RGBA32F : GPU_RGBA16F; | const eGPUTextureFormat texture_format = (tot_samples > 256) ? GPU_RGBA32F : GPU_RGBA16F; | ||||
| DRW_texture_ensure_fullscreen_2d(&txl->ssr_accum, texture_format, 0); | DRW_texture_ensure_fullscreen_2d(&txl->ssr_accum, texture_format, 0); | ||||
| GPU_framebuffer_ensure_config(&fbl->ssr_accum_fb, | GPU_framebuffer_ensure_config(&fbl->ssr_accum_fb, | ||||
| {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->ssr_accum)}); | {GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE(txl->ssr_accum)}); | ||||
| /* Clear texture. */ | |||||
| if (effects->taa_current_sample == 1) { | |||||
| GPU_framebuffer_bind(fbl->ssr_accum_fb); | |||||
| GPU_framebuffer_clear_color(fbl->ssr_accum_fb, clear); | |||||
| } | |||||
| } | } | ||||
| void EEVEE_reflection_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) | void EEVEE_reflection_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) | ||||
| { | { | ||||
| EEVEE_FramebufferList *fbl = vedata->fbl; | EEVEE_FramebufferList *fbl = vedata->fbl; | ||||
| EEVEE_PassList *psl = vedata->psl; | EEVEE_PassList *psl = vedata->psl; | ||||
| EEVEE_StorageList *stl = vedata->stl; | EEVEE_StorageList *stl = vedata->stl; | ||||
| EEVEE_EffectsInfo *effects = vedata->stl->effects; | |||||
| if (stl->g_data->valid_double_buffer) { | if (stl->g_data->valid_double_buffer) { | ||||
| GPU_framebuffer_bind(fbl->ssr_accum_fb); | GPU_framebuffer_bind(fbl->ssr_accum_fb); | ||||
| /* Clear texture. */ | |||||
| if (effects->taa_current_sample == 1) { | |||||
| const float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f}; | |||||
| GPU_framebuffer_clear_color(fbl->ssr_accum_fb, clear); | |||||
| } | |||||
| DRW_draw_pass(psl->ssr_resolve); | DRW_draw_pass(psl->ssr_resolve); | ||||
| } | } | ||||
| } | } | ||||