Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_private.h
| Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | typedef struct WORKBENCH_PrivateData { | ||||
| struct GPUShader *transparent_accum_sh; | struct GPUShader *transparent_accum_sh; | ||||
| struct GPUShader *transparent_accum_hair_sh; | struct GPUShader *transparent_accum_hair_sh; | ||||
| struct GPUShader *transparent_accum_uniform_sh; | struct GPUShader *transparent_accum_uniform_sh; | ||||
| struct GPUShader *transparent_accum_uniform_hair_sh; | struct GPUShader *transparent_accum_uniform_hair_sh; | ||||
| struct GPUShader *transparent_accum_textured_sh; | struct GPUShader *transparent_accum_textured_sh; | ||||
| View3DShading shading; | View3DShading shading; | ||||
| StudioLight *studio_light; | StudioLight *studio_light; | ||||
| const UserDef *preferences; | const UserDef *preferences; | ||||
| /* Does this instance owns the `world_ubo` field. | |||||
| * the field can be borrowed from the WORKBENCH_WorldData */ | |||||
| bool is_world_ubo_owner; | |||||
| struct GPUUniformBuffer *world_ubo; | struct GPUUniformBuffer *world_ubo; | ||||
| struct DRWShadingGroup *shadow_shgrp; | struct DRWShadingGroup *shadow_shgrp; | ||||
| struct DRWShadingGroup *depth_shgrp; | struct DRWShadingGroup *depth_shgrp; | ||||
| WORKBENCH_UBO_World world_data; | WORKBENCH_UBO_World world_data; | ||||
| float shadow_multiplier; | float shadow_multiplier; | ||||
| float shadow_shift; | float shadow_shift; | ||||
| float shadow_focus; | float shadow_focus; | ||||
| float cached_shadow_direction[3]; | float cached_shadow_direction[3]; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | typedef struct WORKBENCH_ObjectData { | ||||
| /* Shadow direction in local object space. */ | /* Shadow direction in local object space. */ | ||||
| float shadow_dir[3], shadow_depth; | float shadow_dir[3], shadow_depth; | ||||
| /* Min, max in shadow space */ | /* Min, max in shadow space */ | ||||
| float shadow_min[3], shadow_max[3]; | float shadow_min[3], shadow_max[3]; | ||||
| BoundBox shadow_bbox; | BoundBox shadow_bbox; | ||||
| bool shadow_bbox_dirty; | bool shadow_bbox_dirty; | ||||
| } WORKBENCH_ObjectData; | } WORKBENCH_ObjectData; | ||||
| typedef struct WORKBENCH_WorldData { | |||||
| DrawData dd; | |||||
| /* Copy of the last used world_data to check if `world_ubo` can be reused */ | |||||
| WORKBENCH_UBO_World world_data; | |||||
| /* The cached GPUUniformBuffer */ | |||||
| struct GPUUniformBuffer *world_ubo; | |||||
| } WORKBENCH_WorldData; | |||||
| /* inline helper functions */ | /* inline helper functions */ | ||||
| BLI_INLINE bool workbench_is_specular_highlight_enabled(WORKBENCH_PrivateData *wpd) | BLI_INLINE bool workbench_is_specular_highlight_enabled(WORKBENCH_PrivateData *wpd) | ||||
| { | { | ||||
| if ((wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT)) { | if ((wpd->shading.flag & V3D_SHADING_SPECULAR_HIGHLIGHT)) { | ||||
| if (STUDIOLIGHT_ENABLED(wpd) || MATCAP_ENABLED(wpd)) { | if (STUDIOLIGHT_ENABLED(wpd) || MATCAP_ENABLED(wpd)) { | ||||
| return (wpd->studio_light->flag & STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS) != 0; | return (wpd->studio_light->flag & STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS) != 0; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | |||||
| bool studiolight_camera_in_object_shadow(WORKBENCH_PrivateData *wpd, | bool studiolight_camera_in_object_shadow(WORKBENCH_PrivateData *wpd, | ||||
| Object *ob, | Object *ob, | ||||
| WORKBENCH_ObjectData *oed); | WORKBENCH_ObjectData *oed); | ||||
| /* workbench_data.c */ | /* workbench_data.c */ | ||||
| void workbench_effect_info_init(WORKBENCH_EffectInfo *effect_info); | void workbench_effect_info_init(WORKBENCH_EffectInfo *effect_info); | ||||
| void workbench_private_data_init(WORKBENCH_PrivateData *wpd); | void workbench_private_data_init(WORKBENCH_PrivateData *wpd); | ||||
| void workbench_private_data_free(WORKBENCH_PrivateData *wpd); | void workbench_private_data_free(WORKBENCH_PrivateData *wpd); | ||||
| void workbench_private_data_get_light_direction(WORKBENCH_PrivateData *wpd, | void workbench_private_data_get_light_direction(float r_light_direction[3]); | ||||
| float r_light_direction[3]); | |||||
| /* workbench_volume.c */ | /* workbench_volume.c */ | ||||
| void workbench_volume_engine_init(void); | void workbench_volume_engine_init(void); | ||||
| void workbench_volume_engine_free(void); | void workbench_volume_engine_free(void); | ||||
| void workbench_volume_cache_init(WORKBENCH_Data *vedata); | void workbench_volume_cache_init(WORKBENCH_Data *vedata); | ||||
| void workbench_volume_cache_populate(WORKBENCH_Data *vedata, | void workbench_volume_cache_populate(WORKBENCH_Data *vedata, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| Show All 13 Lines | |||||