Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_motion_blur.c
| Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| void EEVEE_motion_blur_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) | void EEVEE_motion_blur_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) | ||||
| { | { | ||||
| EEVEE_PassList *psl = vedata->psl; | EEVEE_PassList *psl = vedata->psl; | ||||
| EEVEE_TextureList *txl = vedata->txl; | |||||
| EEVEE_StorageList *stl = vedata->stl; | EEVEE_StorageList *stl = vedata->stl; | ||||
| EEVEE_EffectsInfo *effects = stl->effects; | EEVEE_EffectsInfo *effects = stl->effects; | ||||
| DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); | DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); | ||||
| struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); | struct GPUBatch *quad = DRW_cache_fullscreen_quad_get(); | ||||
| if ((effects->enabled_effects & EFFECT_MOTION_BLUR) != 0) { | if ((effects->enabled_effects & EFFECT_MOTION_BLUR) != 0) { | ||||
| psl->motion_blur = DRW_pass_create("Motion Blur", DRW_STATE_WRITE_COLOR); | psl->motion_blur = DRW_pass_create("Motion Blur", DRW_STATE_WRITE_COLOR); | ||||
| DRWShadingGroup *grp = DRW_shgroup_create(e_data.motion_blur_sh, psl->motion_blur); | DRWShadingGroup *grp = DRW_shgroup_create(e_data.motion_blur_sh, psl->motion_blur); | ||||
| DRW_shgroup_uniform_int(grp, "samples", &effects->motion_blur_samples, 1); | DRW_shgroup_uniform_int(grp, "samples", &effects->motion_blur_samples, 1); | ||||
| DRW_shgroup_uniform_mat4(grp, "currInvViewProjMatrix", effects->current_ndc_to_world); | DRW_shgroup_uniform_mat4(grp, "currInvViewProjMatrix", effects->current_ndc_to_world); | ||||
| DRW_shgroup_uniform_mat4(grp, "pastViewProjMatrix", effects->past_world_to_ndc); | DRW_shgroup_uniform_mat4(grp, "pastViewProjMatrix", effects->past_world_to_ndc); | ||||
| DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer); | DRW_shgroup_uniform_texture_ref(grp, "colorBuffer", &effects->source_buffer); | ||||
| DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", &dtxl->depth); | DRW_shgroup_uniform_texture_ref(grp, "depthBuffer", txl->depth ? &txl->depth : &dtxl->depth); | ||||
| DRW_shgroup_call_add(grp, quad, NULL); | DRW_shgroup_call_add(grp, quad, NULL); | ||||
| } | } | ||||
| } | } | ||||
| void EEVEE_motion_blur_draw(EEVEE_Data *vedata) | void EEVEE_motion_blur_draw(EEVEE_Data *vedata) | ||||
| { | { | ||||
| EEVEE_PassList *psl = vedata->psl; | EEVEE_PassList *psl = vedata->psl; | ||||
| EEVEE_TextureList *txl = vedata->txl; | EEVEE_TextureList *txl = vedata->txl; | ||||
| Show All 16 Lines | |||||