Blender
V3.3
|
#include "DRW_render.h"
#include "workbench_private.h"
#include "BLI_memblock.h"
#include "DNA_userdef_types.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "GPU_uniform_buffer.h"
Go to the source code of this file.
Functions | |
static void | workbench_studiolight_data_update (WORKBENCH_PrivateData *wpd, WORKBENCH_UBO_World *wd) |
void | workbench_private_data_alloc (WORKBENCH_StorageList *stl) |
void | workbench_private_data_init (WORKBENCH_PrivateData *wpd) |
void | workbench_update_world_ubo (WORKBENCH_PrivateData *wpd) |
void | workbench_update_material_ubos (WORKBENCH_PrivateData *UNUSED(wpd)) |
World Data | |
GPUUniformBuf * | workbench_material_ubo_alloc (WORKBENCH_PrivateData *wpd) |
static void | workbench_ubo_free (void *elem) |
static void | workbench_view_layer_data_free (void *storage) |
static WORKBENCH_ViewLayerData * | workbench_view_layer_data_ensure_ex (struct ViewLayer *view_layer) |
GPUUniformBuf* workbench_material_ubo_alloc | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 26 of file workbench_data.c.
References BLI_memblock_alloc(), GPU_uniformbuf_create, WORKBENCH_PrivateData::material_ubo, MAX_MATERIAL, and NULL.
Referenced by workbench_material_chunk_select(), and workbench_private_data_init().
void workbench_private_data_alloc | ( | WORKBENCH_StorageList * | stl | ) |
Definition at line 125 of file workbench_data.c.
References MEM_callocN, WORKBENCH_PrivateData::taa_sample_len_previous, WORKBENCH_PrivateData::view_updated, and WORKBENCH_StorageList::wpd.
Referenced by workbench_engine_init(), and workbench_render().
void workbench_private_data_init | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 134 of file workbench_data.c.
References RenderData::alphamode, WORKBENCH_PrivateData::background_color, BKE_scene_uses_blender_workbench(), BKE_studiolight_find(), BLI_memblock_alloc(), WORKBENCH_PrivateData::clip_state, View3DShading::color_type, copy_v4_fl(), copy_v4_fl4(), CTX_data_mode_enum_ex(), WORKBENCH_PrivateData::ctx_mode, CULL_BACKFACE_ENABLED, WORKBENCH_PrivateData::cull_state, Scene::display, DRW_context_state_get(), DRW_STATE_CLIP_PLANES, DRW_STATE_CULL_BACK, DRW_state_is_navigating(), DRW_state_is_playback(), View3DShading::flag, World::horb, World::horg, World::horr, WORKBENCH_PrivateData::is_navigating, WORKBENCH_PrivateData::is_playback, View3DShading::light, View3DShading::matcap, WORKBENCH_PrivateData::material_chunk_count, WORKBENCH_PrivateData::material_chunk_curr, WORKBENCH_PrivateData::material_index, WORKBENCH_PrivateData::material_ubo, WORKBENCH_ViewLayerData::material_ubo, WORKBENCH_PrivateData::material_ubo_curr, WORKBENCH_PrivateData::material_ubo_data, WORKBENCH_ViewLayerData::material_ubo_data, WORKBENCH_PrivateData::material_ubo_data_curr, NULL, OB_RENDER, OB_SOLID, DRWContextState::obact, DRWContextState::object_edit, DRWContextState::object_mode, WORKBENCH_PrivateData::preferences, Scene::r, R_ALPHAPREMUL, RegionView3D::rflag, DRWContextState::rv3d, RV3D_CLIPPING_ENABLED, RV3D_GPULIGHT_UPDATE, scene, WORKBENCH_PrivateData::scene, DRWContextState::scene, WORKBENCH_PrivateData::sh_cfg, DRWContextState::sh_cfg, WORKBENCH_PrivateData::shading, SceneDisplay::shading, View3D::shading, WORKBENCH_PrivateData::studio_light, View3DShading::studio_light, STUDIOLIGHT_TYPE_MATCAP, STUDIOLIGHT_TYPE_STUDIO, WORKBENCH_PrivateData::taa_sample_len, View3DShading::type, U, UNLIKELY, DRWContextState::v3d, V3D_LIGHTING_FLAT, V3D_LIGHTING_MATCAP, V3D_SHADING_CAVITY, V3D_SHADING_DEPTH_OF_FIELD, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_OBJECT_COLOR, V3D_SHADING_SHADOW, DRWContextState::view_layer, WORKBENCH_PrivateData::view_updated, WORKBENCH_PrivateData::vldata, WORKBENCH_PrivateData::volumes_do, workbench_antialiasing_sample_count_get(), workbench_material_ubo_alloc(), workbench_material_ubo_data(), workbench_view_layer_data_ensure_ex(), Scene::world, WORKBENCH_PrivateData::world_ubo, WORKBENCH_ViewLayerData::world_ubo, XRAY_ALPHA, View3DShading::xray_alpha, XRAY_ENABLED, and XRAY_FLAG_ENABLED.
Referenced by workbench_engine_init().
|
static |
Definition at line 74 of file workbench_data.c.
References WORKBENCH_UBO_World::ambient_color, axis_angle_to_mat4_single(), BKE_studiolight_studio_edit_get(), SolidLight::col, copy_v3_fl(), copy_v3_fl3(), copy_v3_v3(), WORKBENCH_UBO_Light::diffuse_color, DRW_view_viewmat_get(), SolidLight::flag, if(), StudioLight::light, StudioLight::light_ambient, WORKBENCH_UBO_Light::light_direction, WORKBENCH_UBO_World::lights, mul_m4_m4m4(), mul_mat3_m4_v3(), negate_v3(), NULL, WORKBENCH_PrivateData::shading, SolidLight::smooth, SolidLight::spec, WORKBENCH_UBO_Light::specular_color, WORKBENCH_PrivateData::studio_light, View3DShading::studiolight_rot_z, swap_v3_v3(), unit_m4(), WORKBENCH_UBO_World::use_specular, USE_WORLD_ORIENTATION, SolidLight::vec, workbench_is_specular_highlight_enabled(), and WORKBENCH_UBO_Light::wrapped.
Referenced by workbench_update_world_ubo().
Definition at line 35 of file workbench_data.c.
References DRW_UBO_FREE_SAFE.
Referenced by workbench_update_material_ubos(), and workbench_view_layer_data_free().
void workbench_update_material_ubos | ( | WORKBENCH_PrivateData * | UNUSEDwpd | ) |
Definition at line 287 of file workbench_data.c.
References BLI_assert, BLI_memblock_clear(), BLI_memblock_iternew(), BLI_memblock_iterstep(), DRW_context_state_get(), GPU_uniformbuf_update(), WORKBENCH_ViewLayerData::material_ubo, WORKBENCH_ViewLayerData::material_ubo_data, NULL, DRWContextState::view_layer, workbench_ubo_free(), and workbench_view_layer_data_ensure_ex().
Referenced by workbench_cache_finish().
void workbench_update_world_ubo | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 269 of file workbench_data.c.
References DRW_Global::block, copy_v2_v2(), copy_v3_v3(), DRW_state_is_image_render(), DRW_viewport_invert_size_get(), DRW_viewport_size_get(), View3DShading::flag, G_draw, GPU_uniformbuf_update(), WORKBENCH_UBO_World::matcap_orientation, View3DShading::object_outline_color, WORKBENCH_UBO_World::object_outline_color, WORKBENCH_PrivateData::shading, GlobalsUboStorage::size_pixel, WORKBENCH_UBO_World::ui_scale, V3D_SHADING_MATCAP_FLIP_X, WORKBENCH_UBO_World::viewport_size, WORKBENCH_UBO_World::viewport_size_inv, workbench_cavity_data_update(), workbench_shadow_data_update(), workbench_studiolight_data_update(), and WORKBENCH_PrivateData::world_ubo.
Referenced by workbench_draw_scene(), workbench_engine_init(), and workbench_render().
|
static |
Definition at line 54 of file workbench_data.c.
References BLI_memblock_create_ex(), DRW_view_layer_engine_data_ensure_ex(), GPU_uniformbuf_create_ex(), MAX_MATERIAL, MEM_callocN, NULL, and workbench_view_layer_data_free().
Referenced by workbench_private_data_init(), and workbench_update_material_ubos().
Definition at line 41 of file workbench_data.c.
References BLI_memblock_destroy(), WORKBENCH_ViewLayerData::cavity_jitter_tx, WORKBENCH_ViewLayerData::cavity_sample_ubo, WORKBENCH_ViewLayerData::dof_sample_ubo, DRW_TEXTURE_FREE_SAFE, DRW_UBO_FREE_SAFE, WORKBENCH_ViewLayerData::material_ubo, WORKBENCH_ViewLayerData::material_ubo_data, NULL, workbench_ubo_free(), and WORKBENCH_ViewLayerData::world_ubo.
Referenced by workbench_view_layer_data_ensure_ex().