Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_private.h
| Show First 20 Lines • Show All 627 Lines • ▼ Show 20 Lines | |||||
| /* ************** MOTION BLUR ************ */ | /* ************** MOTION BLUR ************ */ | ||||
| #define MB_PREV 0 | #define MB_PREV 0 | ||||
| #define MB_NEXT 1 | #define MB_NEXT 1 | ||||
| #define MB_CURR 2 | #define MB_CURR 2 | ||||
| typedef struct EEVEE_MotionBlurData { | typedef struct EEVEE_MotionBlurData { | ||||
| /** | |||||
| * Maps #EEVEE_ObjectKey to #EEVEE_ObjectMotionData. | |||||
| */ | |||||
| struct GHash *object; | struct GHash *object; | ||||
| struct GHash *geom; | /** | ||||
| * Maps original #GPUVertBuf to duplicated #GPUVertBuf. | |||||
| * There are two maps for #MB_PREV and #MB_NEXT. | |||||
| * Only the values are owned. | |||||
| */ | |||||
| struct GHash *position_vbo_cache[2]; | |||||
| /** | |||||
| * Maps original #GPUVertBuf to #EEVEE_HairMotionStepData. | |||||
| * There are two maps for #MB_PREV and #MB_NEXT. | |||||
| * Only the values are owned. | |||||
| */ | |||||
| struct GHash *hair_motion_step_cache[2]; | |||||
| struct { | struct { | ||||
| float viewmat[4][4]; | float viewmat[4][4]; | ||||
| float persmat[4][4]; | float persmat[4][4]; | ||||
| float persinv[4][4]; | float persinv[4][4]; | ||||
| } camera[3]; | } camera[3]; | ||||
| DRWShadingGroup *hair_grp; | DRWShadingGroup *hair_grp; | ||||
| } EEVEE_MotionBlurData; | } EEVEE_MotionBlurData; | ||||
| typedef struct EEVEE_ObjectKey { | typedef struct EEVEE_ObjectKey { | ||||
| /** Object or source object for duplis */ | /** Object or source object for duplis */ | ||||
| struct Object *ob; | struct Object *ob; | ||||
| /** Parent object for duplis */ | /** Parent object for duplis */ | ||||
| struct Object *parent; | struct Object *parent; | ||||
| /** Dupli objects recursive unique identifier */ | /** Dupli objects recursive unique identifier */ | ||||
| int id[8]; /* MAX_DUPLI_RECUR */ | int id[8]; /* MAX_DUPLI_RECUR */ | ||||
| } EEVEE_ObjectKey; | } EEVEE_ObjectKey; | ||||
| typedef struct EEVEE_ObjectMotionData { | |||||
| float obmat[3][4][4]; | |||||
| } EEVEE_ObjectMotionData; | |||||
| typedef enum eEEVEEMotionData { | typedef enum eEEVEEMotionData { | ||||
| EEVEE_MOTION_DATA_MESH = 0, | EEVEE_MOTION_DATA_MESH = 0, | ||||
| EEVEE_MOTION_DATA_HAIR, | EEVEE_MOTION_DATA_HAIR, | ||||
| } eEEVEEMotionData; | } eEEVEEMotionData; | ||||
| typedef struct EEVEE_HairMotionStepData { | |||||
| struct GPUVertBuf *hair_pos; | |||||
| struct GPUTexture *hair_pos_tx; | |||||
| } EEVEE_HairMotionStepData; | |||||
| typedef struct EEVEE_HairMotionData { | typedef struct EEVEE_HairMotionData { | ||||
| /** Needs to be first to ensure casting. */ | /** Needs to be first to ensure casting. */ | ||||
| eEEVEEMotionData type; | eEEVEEMotionData type; | ||||
| int use_deform; | int use_deform; | ||||
| /** Allocator will alloc enough slot for all particle systems. Or 1 if it's a hair object. */ | /** Allocator will alloc enough slot for all particle systems. Or 1 if it's a hair object. */ | ||||
| int psys_len; | int psys_len; | ||||
| struct { | struct { | ||||
| struct GPUVertBuf *hair_pos[2]; /* Position buffer for time = t +/- step. */ | /* The vbos and textures are not owned. */ | ||||
| struct GPUTexture *hair_pos_tx[2]; /* Buffer Texture of the corresponding VBO. */ | EEVEE_HairMotionStepData step_data[2]; /* Data for time = t +/- step. */ | ||||
| } psys[0]; | } psys[0]; | ||||
| } EEVEE_HairMotionData; | } EEVEE_HairMotionData; | ||||
| typedef struct EEVEE_GeometryMotionData { | typedef struct EEVEE_GeometryMotionData { | ||||
| /** Needs to be first to ensure casting. */ | /** Needs to be first to ensure casting. */ | ||||
| eEEVEEMotionData type; | eEEVEEMotionData type; | ||||
| /** To disable deform mb if vertcount mismatch. */ | /** To disable deform mb if vertcount mismatch. */ | ||||
| int use_deform; | int use_deform; | ||||
| /* The batch and vbos are not owned. */ | |||||
| struct GPUBatch *batch; /* Batch for time = t. */ | struct GPUBatch *batch; /* Batch for time = t. */ | ||||
| struct GPUVertBuf *vbo[2]; /* VBO for time = t +/- step. */ | struct GPUVertBuf *vbo[2]; /* VBO for time = t +/- step. */ | ||||
| } EEVEE_GeometryMotionData; | } EEVEE_GeometryMotionData; | ||||
| typedef struct EEVEE_ObjectMotionData { | |||||
| float obmat[3][4][4]; | |||||
| EEVEE_GeometryMotionData *geometry_data; | |||||
| EEVEE_HairMotionData *hair_data; | |||||
| } EEVEE_ObjectMotionData; | |||||
| /* ************ EFFECTS DATA ************* */ | /* ************ EFFECTS DATA ************* */ | ||||
| typedef enum EEVEE_EffectsFlag { | typedef enum EEVEE_EffectsFlag { | ||||
| EFFECT_MOTION_BLUR = (1 << 0), | EFFECT_MOTION_BLUR = (1 << 0), | ||||
| EFFECT_BLOOM = (1 << 1), | EFFECT_BLOOM = (1 << 1), | ||||
| EFFECT_DOF = (1 << 2), | EFFECT_DOF = (1 << 2), | ||||
| EFFECT_VOLUMETRIC = (1 << 3), | EFFECT_VOLUMETRIC = (1 << 3), | ||||
| EFFECT_SSR = (1 << 4), | EFFECT_SSR = (1 << 4), | ||||
| ▲ Show 20 Lines • Show All 378 Lines • ▼ Show 20 Lines | typedef struct EEVEE_PrivateData { | ||||
| int render_sample_count_per_timestep; | int render_sample_count_per_timestep; | ||||
| } EEVEE_PrivateData; /* Transient data */ | } EEVEE_PrivateData; /* Transient data */ | ||||
| /* eevee_data.c */ | /* eevee_data.c */ | ||||
| void EEVEE_motion_blur_data_init(EEVEE_MotionBlurData *mb); | void EEVEE_motion_blur_data_init(EEVEE_MotionBlurData *mb); | ||||
| void EEVEE_motion_blur_data_free(EEVEE_MotionBlurData *mb); | void EEVEE_motion_blur_data_free(EEVEE_MotionBlurData *mb); | ||||
| void EEVEE_view_layer_data_free(void *storage); | void EEVEE_view_layer_data_free(void *storage); | ||||
| void EEVEE_motion_hair_step_free(EEVEE_HairMotionStepData *step_data); | |||||
| EEVEE_ViewLayerData *EEVEE_view_layer_data_get(void); | EEVEE_ViewLayerData *EEVEE_view_layer_data_get(void); | ||||
| EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure_ex(struct ViewLayer *view_layer); | EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure_ex(struct ViewLayer *view_layer); | ||||
| EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure(void); | EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure(void); | ||||
| EEVEE_ObjectEngineData *EEVEE_object_data_get(Object *ob); | EEVEE_ObjectEngineData *EEVEE_object_data_get(Object *ob); | ||||
| EEVEE_ObjectEngineData *EEVEE_object_data_ensure(Object *ob); | EEVEE_ObjectEngineData *EEVEE_object_data_ensure(Object *ob); | ||||
| EEVEE_ObjectMotionData *EEVEE_motion_blur_object_data_get(EEVEE_MotionBlurData *mb, | EEVEE_ObjectMotionData *EEVEE_motion_blur_object_data_get(EEVEE_MotionBlurData *mb, Object *ob); | ||||
| Object *ob, | EEVEE_GeometryMotionData *EEVEE_motion_blur_geometry_data_get(EEVEE_ObjectMotionData *mb_data); | ||||
| bool hair); | EEVEE_HairMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_ObjectMotionData *mb_data, Object *ob); | ||||
| EEVEE_GeometryMotionData *EEVEE_motion_blur_geometry_data_get(EEVEE_MotionBlurData *mb, | |||||
| Object *ob); | |||||
| EEVEE_HairMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_MotionBlurData *mb, Object *ob); | |||||
| EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_get(Object *ob); | EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_get(Object *ob); | ||||
| EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob); | EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob); | ||||
| EEVEE_LightEngineData *EEVEE_light_data_get(Object *ob); | EEVEE_LightEngineData *EEVEE_light_data_get(Object *ob); | ||||
| EEVEE_LightEngineData *EEVEE_light_data_ensure(Object *ob); | EEVEE_LightEngineData *EEVEE_light_data_ensure(Object *ob); | ||||
| EEVEE_WorldEngineData *EEVEE_world_data_get(World *wo); | EEVEE_WorldEngineData *EEVEE_world_data_get(World *wo); | ||||
| EEVEE_WorldEngineData *EEVEE_world_data_ensure(World *wo); | EEVEE_WorldEngineData *EEVEE_world_data_ensure(World *wo); | ||||
| void eevee_id_update(void *vedata, ID *id); | void eevee_id_update(void *vedata, ID *id); | ||||
| ▲ Show 20 Lines • Show All 547 Lines • Show Last 20 Lines | |||||