Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_motion_blur.c
| Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | void EEVEE_motion_blur_hair_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata), | ||||
| EEVEE_EffectsInfo *effects = stl->effects; | EEVEE_EffectsInfo *effects = stl->effects; | ||||
| DRWShadingGroup *grp = NULL; | DRWShadingGroup *grp = NULL; | ||||
| if (!DRW_state_is_scene_render() || psl->velocity_hair == NULL) { | if (!DRW_state_is_scene_render() || psl->velocity_hair == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* For now we assume hair objects are always moving. */ | /* For now we assume hair objects are always moving. */ | ||||
| EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get(&effects->motion_blur, ob); | EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get( | ||||
| &effects->motion_blur, ob, true); | |||||
| if (mb_data) { | if (mb_data) { | ||||
| int mb_step = effects->motion_blur_step; | int mb_step = effects->motion_blur_step; | ||||
| /* Store transform. */ | /* Store transform. */ | ||||
| DRW_hair_duplimat_get(ob, psys, md, mb_data->obmat[mb_step]); | DRW_hair_duplimat_get(ob, psys, md, mb_data->obmat[mb_step]); | ||||
| EEVEE_HairMotionData *mb_hair = EEVEE_motion_blur_hair_data_get(mb_data, ob); | EEVEE_HairMotionData *mb_hair = EEVEE_motion_blur_hair_data_get(mb_data, ob); | ||||
| int psys_id = (md != NULL) ? BLI_findindex(&ob->modifiers, md) : 0; | int psys_id = (md != NULL) ? BLI_findindex(&ob->modifiers, md) : 0; | ||||
| Show All 40 Lines | void EEVEE_motion_blur_curves_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata), | ||||
| EEVEE_StorageList *stl = vedata->stl; | EEVEE_StorageList *stl = vedata->stl; | ||||
| EEVEE_EffectsInfo *effects = stl->effects; | EEVEE_EffectsInfo *effects = stl->effects; | ||||
| if (!DRW_state_is_scene_render() || psl->velocity_hair == NULL) { | if (!DRW_state_is_scene_render() || psl->velocity_hair == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* For now we assume curves objects are always moving. */ | /* For now we assume curves objects are always moving. */ | ||||
| EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get(&effects->motion_blur, ob); | EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get( | ||||
| &effects->motion_blur, ob, false); | |||||
| if (mb_data == NULL) { | if (mb_data == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| int mb_step = effects->motion_blur_step; | int mb_step = effects->motion_blur_step; | ||||
| /* Store transform. */ | /* Store transform. */ | ||||
| copy_m4_m4(mb_data->obmat[mb_step], ob->obmat); | copy_m4_m4(mb_data->obmat[mb_step], ob->obmat); | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| const bool is_deform = BKE_object_is_deform_modified(DRW_context_state_get()->scene, ob) || | const bool is_deform = BKE_object_is_deform_modified(DRW_context_state_get()->scene, ob) || | ||||
| (has_rigidbody && (rbo->flag & RBO_FLAG_USE_DEFORM) != 0); | (has_rigidbody && (rbo->flag & RBO_FLAG_USE_DEFORM) != 0); | ||||
| if (!(object_moves || is_deform)) { | if (!(object_moves || is_deform)) { | ||||
| return; | return; | ||||
| } | } | ||||
| EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get(&effects->motion_blur, ob); | EEVEE_ObjectMotionData *mb_data = EEVEE_motion_blur_object_data_get( | ||||
| &effects->motion_blur, ob, false); | |||||
| if (mb_data) { | if (mb_data) { | ||||
| int mb_step = effects->motion_blur_step; | int mb_step = effects->motion_blur_step; | ||||
| /* Store transform. */ | /* Store transform. */ | ||||
| copy_m4_m4(mb_data->obmat[mb_step], ob->obmat); | copy_m4_m4(mb_data->obmat[mb_step], ob->obmat); | ||||
| EEVEE_GeometryMotionData *mb_geom = EEVEE_motion_blur_geometry_data_get(mb_data); | EEVEE_GeometryMotionData *mb_geom = EEVEE_motion_blur_geometry_data_get(mb_data); | ||||
| ▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines | |||||