Blender
V3.3
|
#include "BKE_studiolight.h"
#include "DNA_image_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
#include "DRW_render.h"
#include "workbench_engine.h"
Go to the source code of this file.
Classes | |
struct | WORKBENCH_FramebufferList |
struct | WORKBENCH_TextureList |
struct | WORKBENCH_StorageList |
struct | WORKBENCH_PassList |
struct | WORKBENCH_Data |
struct | WORKBENCH_UBO_Light |
struct | WORKBENCH_UBO_Material |
struct | WORKBENCH_UBO_World |
struct | WORKBENCH_Prepass |
struct | WORKBENCH_PrivateData |
struct | WORKBENCH_ObjectData |
struct | WORKBENCH_ViewLayerData |
Typedefs | |
typedef enum eWORKBENCH_DataType | eWORKBENCH_DataType |
typedef enum eWORKBENCH_VolumeInterpType | eWORKBENCH_VolumeInterpType |
typedef struct WORKBENCH_FramebufferList | WORKBENCH_FramebufferList |
typedef struct WORKBENCH_TextureList | WORKBENCH_TextureList |
typedef struct WORKBENCH_StorageList | WORKBENCH_StorageList |
typedef struct WORKBENCH_PassList | WORKBENCH_PassList |
typedef struct WORKBENCH_Data | WORKBENCH_Data |
typedef struct WORKBENCH_UBO_Light | WORKBENCH_UBO_Light |
typedef struct WORKBENCH_UBO_Material | WORKBENCH_UBO_Material |
typedef struct WORKBENCH_UBO_World | WORKBENCH_UBO_World |
typedef struct WORKBENCH_Prepass | WORKBENCH_Prepass |
typedef struct WORKBENCH_PrivateData | WORKBENCH_PrivateData |
typedef struct WORKBENCH_ObjectData | WORKBENCH_ObjectData |
typedef struct WORKBENCH_ViewLayerData | WORKBENCH_ViewLayerData |
Variables | |
struct DrawEngineType | draw_engine_workbench |
#define CAVITY_ENABLED | ( | wpd | ) | (CURVATURE_ENABLED(wpd) || SSAO_ENABLED(wpd)) |
Definition at line 50 of file workbench_private.h.
#define CULL_BACKFACE_ENABLED | ( | wpd | ) | ((wpd->shading.flag & V3D_SHADING_BACKFACE_CULLING) != 0) |
Definition at line 52 of file workbench_private.h.
#define CURVATURE_ENABLED | ( | wpd | ) |
Definition at line 46 of file workbench_private.h.
#define DEBUG_SHADOW_VOLUME 0 |
Definition at line 31 of file workbench_private.h.
#define MATCAP_ENABLED | ( | wpd | ) | (wpd->shading.light == V3D_LIGHTING_MATCAP) |
Definition at line 34 of file workbench_private.h.
#define MAX_MATERIAL (1 << 12) |
Definition at line 29 of file workbench_private.h.
#define NORMAL_ENCODING_ENABLED | ( | ) | (true) |
Definition at line 56 of file workbench_private.h.
#define OBJECT_ID_PASS_ENABLED | ( | wpd | ) | (OBJECT_OUTLINE_ENABLED(wpd) || CURVATURE_ENABLED(wpd)) |
Definition at line 55 of file workbench_private.h.
#define OBJECT_OUTLINE_ENABLED | ( | wpd | ) | (wpd->shading.flag & V3D_SHADING_OBJECT_OUTLINE) |
Definition at line 54 of file workbench_private.h.
#define SHADOW_ENABLED | ( | wpd | ) | (wpd->shading.flag & V3D_SHADING_SHADOW) |
Definition at line 51 of file workbench_private.h.
#define SSAO_ENABLED | ( | wpd | ) |
Definition at line 42 of file workbench_private.h.
#define STUDIOLIGHT_ENABLED | ( | wpd | ) | (wpd->shading.light == V3D_LIGHTING_STUDIO) |
Definition at line 33 of file workbench_private.h.
#define STUDIOLIGHT_TYPE_MATCAP_ENABLED | ( | wpd | ) | (MATCAP_ENABLED(wpd) && (wpd->studio_light->flag & STUDIOLIGHT_TYPE_MATCAP)) |
Definition at line 40 of file workbench_private.h.
#define STUDIOLIGHT_TYPE_STUDIO_ENABLED | ( | wpd | ) | (STUDIOLIGHT_ENABLED(wpd) && (wpd->studio_light->flag & STUDIOLIGHT_TYPE_STUDIO)) |
Definition at line 38 of file workbench_private.h.
#define STUDIOLIGHT_TYPE_WORLD_ENABLED | ( | wpd | ) | (STUDIOLIGHT_ENABLED(wpd) && (wpd->studio_light->flag & STUDIOLIGHT_TYPE_WORLD)) |
Definition at line 36 of file workbench_private.h.
#define USE_WORLD_ORIENTATION | ( | wpd | ) | ((wpd->shading.flag & V3D_SHADING_WORLD_ORIENTATION) != 0) |
Definition at line 35 of file workbench_private.h.
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH" |
Definition at line 27 of file workbench_private.h.
#define workbench_image_hair_setup | ( | wpd, | |
ob, | |||
mat_nr, | |||
ima, | |||
iuser, | |||
interp | |||
) | workbench_image_setup_ex(wpd, ob, mat_nr, ima, iuser, interp, WORKBENCH_DATATYPE_HAIR) |
Definition at line 511 of file workbench_private.h.
#define workbench_image_setup | ( | wpd, | |
ob, | |||
mat_nr, | |||
ima, | |||
iuser, | |||
interp | |||
) | workbench_image_setup_ex(wpd, ob, mat_nr, ima, iuser, interp, WORKBENCH_OBJECT_DATATYPE(ob)) |
Definition at line 506 of file workbench_private.h.
#define workbench_material_hair_setup | ( | wpd, | |
ob, | |||
mat_nr, | |||
color_type | |||
) | workbench_material_setup_ex(wpd, ob, mat_nr, color_type, WORKBENCH_DATATYPE_HAIR, 0) |
Definition at line 509 of file workbench_private.h.
#define workbench_material_setup | ( | wpd, | |
ob, | |||
mat_nr, | |||
color_type, | |||
r_transp | |||
) | workbench_material_setup_ex(wpd, ob, mat_nr, color_type, WORKBENCH_OBJECT_DATATYPE(ob), r_transp) |
Definition at line 504 of file workbench_private.h.
#define WORKBENCH_OBJECT_DATATYPE | ( | ob | ) | ((ob->type == OB_POINTCLOUD) ? WORKBENCH_DATATYPE_POINTCLOUD : WORKBENCH_DATATYPE_MESH) |
Definition at line 501 of file workbench_private.h.
typedef enum eWORKBENCH_DataType eWORKBENCH_DataType |
typedef enum eWORKBENCH_VolumeInterpType eWORKBENCH_VolumeInterpType |
typedef struct WORKBENCH_Data WORKBENCH_Data |
typedef struct WORKBENCH_FramebufferList WORKBENCH_FramebufferList |
typedef struct WORKBENCH_ObjectData WORKBENCH_ObjectData |
typedef struct WORKBENCH_PassList WORKBENCH_PassList |
typedef struct WORKBENCH_Prepass WORKBENCH_Prepass |
typedef struct WORKBENCH_PrivateData WORKBENCH_PrivateData |
typedef struct WORKBENCH_StorageList WORKBENCH_StorageList |
typedef struct WORKBENCH_TextureList WORKBENCH_TextureList |
typedef struct WORKBENCH_UBO_Light WORKBENCH_UBO_Light |
typedef struct WORKBENCH_UBO_Material WORKBENCH_UBO_Material |
typedef struct WORKBENCH_UBO_World WORKBENCH_UBO_World |
typedef struct WORKBENCH_ViewLayerData WORKBENCH_ViewLayerData |
enum eWORKBENCH_DataType |
Enumerator | |
---|---|
WORKBENCH_DATATYPE_MESH | |
WORKBENCH_DATATYPE_HAIR | |
WORKBENCH_DATATYPE_POINTCLOUD | |
WORKBENCH_DATATYPE_MAX |
Definition at line 63 of file workbench_private.h.
Enumerator | |
---|---|
WORKBENCH_VOLUME_INTERP_LINEAR | |
WORKBENCH_VOLUME_INTERP_CUBIC | |
WORKBENCH_VOLUME_INTERP_CLOSEST |
Definition at line 72 of file workbench_private.h.
void workbench_antialiasing_cache_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 290 of file workbench_effect_antialiasing.c.
References WORKBENCH_PassList::aa_accum_ps, WORKBENCH_PassList::aa_accum_replace_ps, WORKBENCH_PassList::aa_edge_ps, WORKBENCH_PassList::aa_resolve_ps, WORKBENCH_PassList::aa_weight_ps, DefaultTextureList::color, DRW_PASS_CREATE, DRW_PASS_INSTANCE_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_clear_framebuffer(), DRW_shgroup_create(), DRW_shgroup_uniform_float(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_vec4_copy(), DRW_STATE_BLEND_ADD_FULL, DRW_STATE_WRITE_COLOR, DRW_viewport_invert_size_get(), DRW_viewport_size_get(), DRW_viewport_texture_list_get(), GPU_COLOR_BIT, GPU_SAMPLER_DEFAULT, WORKBENCH_TextureList::history_buffer_tx, NULL, WORKBENCH_Data::psl, sh, size(), WORKBENCH_TextureList::smaa_area_tx, WORKBENCH_PrivateData::smaa_edge_tx, WORKBENCH_PrivateData::smaa_mix_factor, WORKBENCH_TextureList::smaa_search_tx, WORKBENCH_PrivateData::smaa_weight_tx, WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample_len, WORKBENCH_PrivateData::taa_weight_accum, WORKBENCH_PrivateData::taa_weights, WORKBENCH_Data::txl, workbench_shader_antialiasing_accumulation_get(), workbench_shader_antialiasing_get(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_cache_init().
void workbench_antialiasing_draw_pass | ( | WORKBENCH_Data * | vedata | ) |
We always do SMAA on top of TAA accumulation, unless the number of samples of TAA is already high. This ensure a smoother transition. If TAA accumulation is finished, we only blit the result.
Definition at line 422 of file workbench_effect_antialiasing.c.
References WORKBENCH_PassList::aa_accum_ps, WORKBENCH_PassList::aa_accum_replace_ps, WORKBENCH_PassList::aa_edge_ps, WORKBENCH_PassList::aa_resolve_ps, WORKBENCH_PassList::aa_weight_ps, WORKBENCH_FramebufferList::antialiasing_fb, clamp_f(), DefaultFramebufferList::default_fb, DefaultTextureList::depth, WORKBENCH_TextureList::depth_buffer_in_front_tx, WORKBENCH_TextureList::depth_buffer_tx, DefaultTextureList::depth_in_front, DRW_draw_pass(), DRW_state_is_image_render(), DRW_viewport_framebuffer_list_get(), DRW_viewport_request_redraw(), DRW_viewport_texture_list_get(), WORKBENCH_Data::fbl, GPU_framebuffer_bind(), GPU_texture_copy(), WORKBENCH_PrivateData::is_playback, WORKBENCH_Data::psl, WORKBENCH_FramebufferList::smaa_edge_fb, WORKBENCH_PrivateData::smaa_mix_factor, WORKBENCH_FramebufferList::smaa_weight_fb, WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample, WORKBENCH_PrivateData::taa_sample_len, WORKBENCH_PrivateData::taa_weight_accum, WORKBENCH_PrivateData::taa_weights_sum, WORKBENCH_Data::txl, WORKBENCH_PrivateData::valid_history, workbench_in_front_history_needed(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_draw_sample().
void workbench_antialiasing_engine_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 146 of file workbench_effect_antialiasing.c.
References WORKBENCH_FramebufferList::antialiasing_fb, WORKBENCH_FramebufferList::antialiasing_in_front_fb, AREATEX_HEIGHT, AREATEX_WIDTH, areaTexBytes, copy_m4_m4(), WORKBENCH_TextureList::depth_buffer_in_front_tx, WORKBENCH_TextureList::depth_buffer_tx, DRW_TEX_FILTER, DRW_texture_ensure_fullscreen_2d(), DRW_TEXTURE_FREE_SAFE, DRW_texture_pool_query_fullscreen(), DRW_view_persmat_get(), equals_m4m4(), WORKBENCH_Data::fbl, GPU_DATA_UBYTE, GPU_DEPTH24_STENCIL8, GPU_R8, GPU_RG8, GPU_RGBA16F, GPU_RGBA8, GPU_texture_create_2d(), GPU_texture_filter_mode(), GPU_texture_update(), WORKBENCH_TextureList::history_buffer_tx, WORKBENCH_PrivateData::is_navigating, WORKBENCH_PrivateData::is_playback, WORKBENCH_PrivateData::last_mat, NULL, WORKBENCH_PrivateData::reset_next_sample, SEARCHTEX_HEIGHT, SEARCHTEX_WIDTH, searchTexBytes, WORKBENCH_TextureList::smaa_area_tx, WORKBENCH_FramebufferList::smaa_edge_fb, WORKBENCH_PrivateData::smaa_edge_tx, WORKBENCH_TextureList::smaa_search_tx, WORKBENCH_FramebufferList::smaa_weight_fb, WORKBENCH_PrivateData::smaa_weight_tx, WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample, WORKBENCH_PrivateData::taa_sample_len, WORKBENCH_PrivateData::taa_sample_len_previous, WORKBENCH_Data::txl, WORKBENCH_PrivateData::valid_history, WORKBENCH_PrivateData::view, WORKBENCH_PrivateData::view_updated, workbench_in_front_history_needed(), workbench_taa_jitter_init(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_engine_init().
int workbench_antialiasing_sample_count_get | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 98 of file workbench_effect_antialiasing.c.
References Scene::display, DRW_context_state_get(), DRW_state_is_image_render(), WORKBENCH_PrivateData::is_navigating, WORKBENCH_PrivateData::is_playback, min_ii(), WORKBENCH_PrivateData::preferences, SceneDisplay::render_aa, scene, DRWContextState::scene, DRWContextState::v3d, SceneDisplay::viewport_aa, and UserDef::viewport_aa.
Referenced by workbench_private_data_init().
bool workbench_antialiasing_setup | ( | WORKBENCH_Data * | vedata | ) |
Return true if render is not cached.
Definition at line 359 of file workbench_effect_antialiasing.c.
References DRW_view_create_sub(), DRW_view_default_get(), DRW_view_persmat_get(), DRW_view_set_active(), DRW_view_update_sub(), DRW_view_viewmat_get(), DRW_view_winmat_get(), DRW_viewport_size_get(), e_data, min_ii(), WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample, WORKBENCH_PrivateData::taa_sample_len, WORKBENCH_PrivateData::taa_weights, WORKBENCH_PrivateData::taa_weights_sum, WORKBENCH_PrivateData::view, window_translate_m4(), workbench_antialiasing_weights_get(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_draw_sample().
void workbench_antialiasing_view_updated | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 118 of file workbench_effect_antialiasing.c.
References WORKBENCH_Data::stl, WORKBENCH_PrivateData::view_updated, and WORKBENCH_StorageList::wpd.
Referenced by workbench_view_update().
Definition at line 444 of file workbench_engine.c.
References BLI_ghash_free(), DefaultTextureList::depth_in_front, DRW_texture_ensure_fullscreen_2d(), DRW_viewport_framebuffer_list_get(), DRW_viewport_texture_list_get(), WORKBENCH_Data::fbl, GPU_DEPTH24_STENCIL8, WORKBENCH_FramebufferList::id_clear_fb, DefaultFramebufferList::in_front_fb, WORKBENCH_Prepass::material_hash, NULL, WORKBENCH_PrivateData::object_id_tx, WORKBENCH_FramebufferList::opaque_infront_fb, WORKBENCH_PrivateData::prepass, WORKBENCH_Data::stl, WORKBENCH_FramebufferList::transp_accum_infront_fb, WORKBENCH_DATATYPE_MAX, workbench_update_material_ubos(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_render().
Definition at line 69 of file workbench_engine.c.
References workbench_antialiasing_cache_init(), workbench_cavity_cache_init(), workbench_dof_cache_init(), workbench_opaque_cache_init(), workbench_outline_cache_init(), workbench_shadow_cache_init(), workbench_transparent_cache_init(), and workbench_volume_cache_init().
Referenced by workbench_render().
Definition at line 359 of file workbench_engine.c.
References Object::base_flag, BASE_FROM_DUPLI, BKE_modifier_is_enabled(), BKE_modifiers_findby_type(), CURVES_MATERIAL_NR, FluidModifierData::domain, ParticleSettings::draw_as, DRW_object_is_renderable(), DRW_object_is_visible_psys_in_active_context(), DRW_object_visibility_in_active_context(), DRW_shgroup_curves_create_sub(), DRW_state_is_scene_render(), Object::dt, ELEM, eModifierMode_Realtime, eModifierType_Fluid, eModifierType_ParticleSystem, ListBase::first, FLUID_DOMAIN_TYPE_GAS, if(), LISTBASE_FOREACH, Object::modifiers, NULL, OB_CURVES, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SOLID, OB_SURF, OB_VISIBLE_SELF, OB_VOLUME, OB_WIRE, ParticleSettings::omat, ParticleSystem::part, PART_DRAW_PATH, PART_DRAW_REND, ParticleSettings::ren_as, WORKBENCH_PrivateData::scene, WORKBENCH_PrivateData::shading, WORKBENCH_Data::stl, FluidDomainSettings::type, Object::type, View3DShading::type, V3D_SHADING_SINGLE_COLOR, workbench_cache_common_populate(), workbench_cache_hair_populate(), workbench_cache_sculpt_populate(), workbench_cache_texpaint_populate(), workbench_color_type_get(), workbench_material_hair_setup, workbench_shadow_cache_populate(), workbench_volume_cache_populate(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_render_cache().
void workbench_cavity_cache_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 134 of file workbench_effect_cavity.c.
References CAVITY_ENABLED, WORKBENCH_ViewLayerData::cavity_jitter_tx, WORKBENCH_PassList::cavity_ps, WORKBENCH_ViewLayerData::cavity_sample_ubo, CURVATURE_ENABLED, data, DefaultTextureList::depth, DRW_PASS_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_texture(), DRW_STATE_BLEND_MUL, DRW_STATE_WRITE_COLOR, DRW_viewport_texture_list_get(), WORKBENCH_PrivateData::normal_buffer_tx, NULL, WORKBENCH_PrivateData::object_id_tx, sh, SSAO_ENABLED, state, WORKBENCH_PrivateData::vldata, workbench_cavity_samples_ubo_ensure(), workbench_shader_cavity_get(), and WORKBENCH_PrivateData::world_ubo.
Referenced by workbench_cache_init().
void workbench_cavity_data_update | ( | WORKBENCH_PrivateData * | wpd, |
WORKBENCH_UBO_World * | wd | ||
) |
Definition at line 81 of file workbench_effect_cavity.c.
References WORKBENCH_UBO_World::cavity_attenuation, WORKBENCH_UBO_World::cavity_distance, CAVITY_ENABLED, WORKBENCH_UBO_World::cavity_jitter_scale, WORKBENCH_UBO_World::cavity_ridge_factor, View3DShading::cavity_ridge_factor, WORKBENCH_UBO_World::cavity_sample_count_inv, WORKBENCH_UBO_World::cavity_sample_end, WORKBENCH_UBO_World::cavity_sample_start, WORKBENCH_UBO_World::cavity_valley_factor, View3DShading::cavity_valley_factor, WORKBENCH_UBO_World::curvature_ridge, View3DShading::curvature_ridge_factor, WORKBENCH_UBO_World::curvature_valley, View3DShading::curvature_valley_factor, Scene::display, DRW_context_state_get(), SceneDisplay::matcap_ssao_attenuation, SceneDisplay::matcap_ssao_distance, SceneDisplay::matcap_ssao_samples, max_ff(), sample, scene, DRWContextState::scene, WORKBENCH_PrivateData::shading, square_f(), WORKBENCH_PrivateData::taa_sample, and workbench_cavity_total_sample_count().
Referenced by workbench_update_world_ubo().
void workbench_cavity_samples_ubo_ensure | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 109 of file workbench_effect_cavity.c.
References WORKBENCH_ViewLayerData::cavity_jitter_tx, CAVITY_MAX_SAMPLES, WORKBENCH_ViewLayerData::cavity_sample_count, WORKBENCH_ViewLayerData::cavity_sample_ubo, create_disk_samples(), create_jitter_texture(), Scene::display, DRW_context_state_get(), DRW_TEXTURE_FREE_SAFE, DRW_UBO_FREE_SAFE, GPU_uniformbuf_create_ex(), SceneDisplay::matcap_ssao_samples, max_ii(), MEM_freeN, NULL, scene, DRWContextState::scene, WORKBENCH_PrivateData::vldata, and workbench_cavity_total_sample_count().
Referenced by workbench_cavity_cache_init(), and workbench_dof_cache_init().
void workbench_dof_cache_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 241 of file workbench_effect_dof.c.
References WORKBENCH_ViewLayerData::cavity_jitter_tx, WORKBENCH_TextureList::coc_halfres_tx, WORKBENCH_PrivateData::coc_temp_tx, WORKBENCH_PrivateData::coc_tiles_tx, DefaultTextureList::color, DefaultTextureList::depth, WORKBENCH_PrivateData::dof_aperturesize, WORKBENCH_PassList::dof_blur1_ps, WORKBENCH_PassList::dof_blur2_ps, WORKBENCH_PrivateData::dof_blur_tx, WORKBENCH_PassList::dof_dilate_h_ps, WORKBENCH_PassList::dof_dilate_v_ps, WORKBENCH_PassList::dof_down2_ps, WORKBENCH_PassList::dof_down_ps, WORKBENCH_PrivateData::dof_enabled, WORKBENCH_PassList::dof_flatten_h_ps, WORKBENCH_PassList::dof_flatten_v_ps, WORKBENCH_PrivateData::dof_near_far, WORKBENCH_PassList::dof_resolve_ps, WORKBENCH_ViewLayerData::dof_sample_ubo, WORKBENCH_TextureList::dof_source_tx, downsample_sh, DRW_pass_create(), DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_texture_ex(), DRW_shgroup_uniform_vec2(), DRW_shgroup_uniform_vec3(), DRW_STATE_BLEND_CUSTOM, DRW_STATE_WRITE_COLOR, DRW_viewport_invert_size_get(), DRW_viewport_texture_list_get(), float(), GPU_SAMPLER_DEFAULT, max_ii(), NULL, offset, WORKBENCH_Data::psl, WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample, WORKBENCH_PrivateData::taa_sample_len, WORKBENCH_Data::txl, WORKBENCH_PrivateData::vldata, workbench_cavity_samples_ubo_ensure(), workbench_shader_depth_of_field_get(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_cache_init().
void workbench_dof_draw_pass | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 353 of file workbench_effect_dof.c.
References DefaultFramebufferList::color_only_fb, WORKBENCH_FramebufferList::dof_blur1_fb, WORKBENCH_PassList::dof_blur1_ps, WORKBENCH_FramebufferList::dof_blur2_fb, WORKBENCH_PassList::dof_blur2_ps, WORKBENCH_FramebufferList::dof_coc_dilate_fb, WORKBENCH_FramebufferList::dof_coc_tile_h_fb, WORKBENCH_FramebufferList::dof_coc_tile_v_fb, WORKBENCH_PassList::dof_dilate_h_ps, WORKBENCH_PassList::dof_dilate_v_ps, WORKBENCH_PassList::dof_down_ps, WORKBENCH_FramebufferList::dof_downsample_fb, WORKBENCH_PrivateData::dof_enabled, WORKBENCH_PassList::dof_flatten_h_ps, WORKBENCH_PassList::dof_flatten_v_ps, WORKBENCH_PassList::dof_resolve_ps, DRW_draw_pass(), DRW_stats_group_end(), DRW_stats_group_start(), DRW_viewport_framebuffer_list_get(), WORKBENCH_Data::fbl, GPU_framebuffer_bind(), GPU_framebuffer_recursive_downsample(), WORKBENCH_Data::psl, WORKBENCH_Data::stl, workbench_dof_downsample_level(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_draw_sample().
void workbench_dof_engine_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 111 of file workbench_effect_dof.c.
References CameraDOFSettings::aperture_blades, CameraDOFSettings::aperture_fstop, CameraDOFSettings::aperture_ratio, CameraDOFSettings::aperture_rotation, BKE_camera_object_dof_distance(), BKE_camera_sensor_size(), CAM_DOF_ENABLED, WORKBENCH_PrivateData::cam_original_ob, View3D::camera, camera, ceilf, Camera::clip_end, Camera::clip_start, WORKBENCH_TextureList::coc_halfres_tx, WORKBENCH_PrivateData::coc_temp_tx, WORKBENCH_PrivateData::coc_tiles_tx, Camera::dof, WORKBENCH_PrivateData::dof_aperturesize, WORKBENCH_PrivateData::dof_blades, WORKBENCH_FramebufferList::dof_blur1_fb, WORKBENCH_FramebufferList::dof_blur2_fb, WORKBENCH_PrivateData::dof_blur_tx, WORKBENCH_FramebufferList::dof_coc_dilate_fb, WORKBENCH_FramebufferList::dof_coc_tile_h_fb, WORKBENCH_FramebufferList::dof_coc_tile_v_fb, WORKBENCH_PrivateData::dof_distance, WORKBENCH_FramebufferList::dof_downsample_fb, WORKBENCH_PrivateData::dof_enabled, WORKBENCH_PrivateData::dof_invsensorsize, WORKBENCH_PrivateData::dof_near_far, WORKBENCH_PrivateData::dof_ratio, WORKBENCH_PrivateData::dof_rotation, WORKBENCH_ViewLayerData::dof_sample_ubo, WORKBENCH_TextureList::dof_source_tx, WORKBENCH_StorageList::dof_ubo_data, draw_engine_workbench, DRW_context_state_get(), DRW_TEX_FILTER, DRW_TEX_MIPMAP, DRW_texture_ensure_2d(), DRW_TEXTURE_FREE_SAFE, DRW_texture_pool_query_2d(), DRW_viewport_size_get(), fabsf, WORKBENCH_Data::fbl, CameraDOFSettings::flag, View3DShading::flag, GPU_RG8, GPU_RGBA16F, Camera::lens, max_ii(), NULL, OB_CAMERA, RegionView3D::persp, DRWContextState::rv3d, RV3D_CAMOB, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, WORKBENCH_PrivateData::shading, size(), WORKBENCH_Data::stl, WORKBENCH_Data::txl, DRWContextState::v3d, V3D_SHADING_DEPTH_OF_FIELD, RegionView3D::viewcamtexcofac, WORKBENCH_PrivateData::vldata, workbench_dof_setup_samples(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_engine_init().
Used by viewport rendering & final rendering. Do one render loop iteration (i.e: One TAA sample).
Definition at line 507 of file workbench_engine.c.
References WORKBENCH_PrivateData::background_color, WORKBENCH_PassList::cavity_ps, DefaultFramebufferList::color_only_fb, WORKBENCH_PassList::composite_ps, DefaultFramebufferList::default_fb, DRW_draw_pass(), DRW_pass_is_empty(), DRW_viewport_framebuffer_list_get(), WORKBENCH_Data::fbl, GPU_framebuffer_bind(), WORKBENCH_FramebufferList::id_clear_fb, DefaultFramebufferList::in_front_fb, WORKBENCH_PassList::merge_infront_ps, WORKBENCH_FramebufferList::opaque_fb, WORKBENCH_FramebufferList::opaque_infront_fb, WORKBENCH_PassList::opaque_infront_ps, WORKBENCH_PassList::opaque_ps, WORKBENCH_PassList::outline_ps, WORKBENCH_Data::psl, WORKBENCH_PrivateData::shading, WORKBENCH_PassList::shadow_ps, WORKBENCH_Data::stl, WORKBENCH_FramebufferList::transp_accum_fb, WORKBENCH_FramebufferList::transp_accum_infront_fb, WORKBENCH_PassList::transp_accum_infront_ps, WORKBENCH_PassList::transp_accum_ps, WORKBENCH_PassList::transp_resolve_ps, workbench_antialiasing_draw_pass(), workbench_antialiasing_setup(), workbench_dof_draw_pass(), workbench_transparent_draw_depth_pass(), workbench_volume_draw_pass(), WORKBENCH_StorageList::wpd, and View3DShading::xray_alpha.
Referenced by workbench_draw_scene(), and workbench_render().
Definition at line 37 of file workbench_engine.c.
References draw_engine_workbench, DRW_texture_create_2d(), DRW_texture_pool_query_fullscreen(), WORKBENCH_TextureList::dummy_image_tx, WORKBENCH_PrivateData::dummy_image_tx, GPU_R16UI, GPU_RGBA8, NULL, OBJECT_ID_PASS_ENABLED, WORKBENCH_PrivateData::object_id_tx, WORKBENCH_Data::stl, WORKBENCH_Data::txl, workbench_antialiasing_engine_init(), workbench_dof_engine_init(), workbench_opaque_engine_init(), workbench_private_data_alloc(), workbench_private_data_init(), workbench_transparent_engine_init(), workbench_update_world_ubo(), workbench_volume_engine_init(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_render().
DRWShadingGroup* workbench_image_setup_ex | ( | WORKBENCH_PrivateData * | wpd, |
Object * | ob, | ||
int | mat_nr, | ||
Image * | ima, | ||
ImageUser * | iuser, | ||
eGPUSamplerState | sampler, | ||
eWORKBENCH_DataType | datatype | ||
) |
If ima
is null, search appropriate image node but will fallback to purple texture otherwise.
Definition at line 232 of file workbench_materials.c.
References Image::alpha_mode, BKE_image_get_gpu_texture(), BKE_image_get_gpu_tilemap(), BKE_image_get_gpu_tiles(), BLI_ghash_ensure_p(), DRW_shgroup_create_sub(), DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_texture_ex(), Object::dtx, WORKBENCH_PrivateData::dummy_image_tx, IMA_ALPHA_PREMUL, IMA_SRC_TILED, WORKBENCH_Prepass::image_shgrp, WORKBENCH_Prepass::image_tiled_shgrp, WORKBENCH_Prepass::material_hash, NULL, OB_DRAW_IN_FRONT, WORKBENCH_PrivateData::prepass, sampler(), WORKBENCH_PrivateData::shading, Image::source, tex, workbench_material_get_image(), and View3DShading::xray_alpha.
Referenced by workbench_material_setup_ex().
BLI_INLINE bool workbench_is_specular_highlight_enabled | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 381 of file workbench_private.h.
References StudioLight::flag, View3DShading::flag, MATCAP_ENABLED, WORKBENCH_PrivateData::shading, WORKBENCH_PrivateData::studio_light, STUDIOLIGHT_ENABLED, STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS, and V3D_SHADING_SPECULAR_HIGHLIGHT.
Referenced by workbench_opaque_cache_init(), workbench_studiolight_data_update(), and workbench_transparent_lighting_uniforms().
DRWShadingGroup* workbench_material_setup_ex | ( | WORKBENCH_PrivateData * | wpd, |
Object * | ob, | ||
int | mat_nr, | ||
eV3DShadingColorType | color_type, | ||
eWORKBENCH_DataType | datatype, | ||
bool * | r_transp | ||
) |
Definition at line 146 of file workbench_materials.c.
References Material::a, BLI_assert, BLI_ghash_ensure_p(), Object::color, View3DShading::color_type, WORKBENCH_Prepass::common_shgrp, DRW_object_resource_id_get(), DRW_shgroup_create_sub(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_int_copy(), Object::dtx, ELEM, WORKBENCH_Prepass::material_hash, WORKBENCH_PrivateData::material_index, WORKBENCH_PrivateData::material_ubo_curr, WORKBENCH_PrivateData::material_ubo_data_curr, NULL, OB_DRAW_IN_FRONT, WORKBENCH_PrivateData::prepass, sampler(), WORKBENCH_PrivateData::shading, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, WORKBENCH_Prepass::vcol_shgrp, workbench_image_setup_ex(), workbench_material_chunk_select(), workbench_material_get_image(), workbench_material_ubo_data(), workbench_object_material_get(), and View3DShading::xray_alpha.
struct 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_material_ubo_data | ( | WORKBENCH_PrivateData * | wpd, |
Object * | ob, | ||
Material * | mat, | ||
WORKBENCH_UBO_Material * | data, | ||
eV3DShadingColorType | color_type | ||
) |
Definition at line 28 of file workbench_materials.c.
References Material::a, BLI_ghashutil_strhash_p_murmur(), BLI_hash_int_01(), Object::color, copy_v3_fl(), copy_v3_v3(), data, Library::filepath, hash, HSV_SATURATION, hsv_to_rgb_v(), HSV_VALUE, hue, Object::id, ID::lib, Material::metallic, metallic, ID::name, Material::r, usdtokens::roughness(), Material::roughness, WORKBENCH_PrivateData::shading, View3DShading::single_color, sqrtf, unit_float_to_uchar_clamp(), V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_OBJECT_COLOR, V3D_SHADING_RANDOM_COLOR, V3D_SHADING_SINGLE_COLOR, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, and View3DShading::xray_alpha.
Referenced by workbench_material_setup_ex(), workbench_private_data_init(), and workbench_volume_material_color().
void workbench_opaque_cache_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 45 of file workbench_opaque.c.
References BKE_studiolight_ensure_flag(), BLI_ghash_ptr_new(), WORKBENCH_PrivateData::clip_state, WORKBENCH_Prepass::common_shgrp, WORKBENCH_PassList::composite_ps, WORKBENCH_PrivateData::cull_state, data, DefaultTextureList::depth_in_front, DRW_PASS_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_create_sub(), DRW_shgroup_state_disable(), DRW_shgroup_state_enable(), DRW_shgroup_stencil_mask(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_texture_ref(), DRW_STATE_DEPTH_ALWAYS, DRW_STATE_DEPTH_GREATER, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_STENCIL_ALWAYS, DRW_STATE_STENCIL_EQUAL, DRW_STATE_STENCIL_NEQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, DRW_STATE_WRITE_STENCIL, DRW_viewport_texture_list_get(), StudioLightImage::gputexture, WORKBENCH_Prepass::image_shgrp, WORKBENCH_Prepass::image_tiled_shgrp, View3DShading::light, StudioLight::matcap_diffuse, StudioLight::matcap_specular, WORKBENCH_PrivateData::material_buffer_tx, WORKBENCH_Prepass::material_hash, WORKBENCH_PrivateData::material_ubo_curr, WORKBENCH_PassList::merge_infront_ps, WORKBENCH_PrivateData::normal_buffer_tx, NULL, WORKBENCH_PassList::opaque_infront_ps, WORKBENCH_PassList::opaque_ps, WORKBENCH_PrivateData::prepass, WORKBENCH_Data::psl, sh, WORKBENCH_PrivateData::shading, SHADOW_ENABLED, state, WORKBENCH_Data::stl, WORKBENCH_PrivateData::studio_light, STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE, STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE, STUDIOLIGHT_TYPE_MATCAP_ENABLED, V3D_LIGHTING_MATCAP, WORKBENCH_Prepass::vcol_shgrp, WORKBENCH_DATATYPE_MAX, workbench_is_specular_highlight_enabled(), workbench_shader_composite_get(), workbench_shader_merge_infront_get(), workbench_shader_opaque_get(), workbench_shader_opaque_image_get(), WORKBENCH_PrivateData::world_ubo, and WORKBENCH_StorageList::wpd.
Referenced by workbench_cache_init().
void workbench_opaque_engine_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 22 of file workbench_opaque.c.
References data, DRW_texture_pool_query_fullscreen(), DRW_viewport_texture_list_get(), GPU_RG16F, GPU_RGBA16F, WORKBENCH_PrivateData::material_buffer_tx, WORKBENCH_PrivateData::normal_buffer_tx, NORMAL_ENCODING_ENABLED, and WORKBENCH_FramebufferList::opaque_fb.
Referenced by workbench_engine_init().
void workbench_outline_cache_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 17 of file workbench_effect_outline.c.
References data, DefaultTextureList::depth, DRW_PASS_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_texture(), DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_WRITE_COLOR, DRW_viewport_texture_list_get(), NULL, WORKBENCH_PrivateData::object_id_tx, OBJECT_OUTLINE_ENABLED, WORKBENCH_PassList::outline_ps, sh, state, workbench_shader_outline_get(), and WORKBENCH_PrivateData::world_ubo.
Referenced by workbench_cache_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().
void workbench_render | ( | void * | ved, |
struct RenderEngine * | engine, | ||
struct RenderLayer * | render_layer, | ||
const struct rcti * | rect | ||
) |
void workbench_render_update_passes | ( | struct RenderEngine * | engine, |
struct Scene * | scene, | ||
struct ViewLayer * | view_layer | ||
) |
Definition at line 214 of file workbench_render.c.
References RE_engine_register_pass(), RE_PASSNAME_COMBINED, scene, and SOCK_RGBA.
Definition at line 290 of file workbench_shader.cc.
References e_data, and GPU_shader_create_from_info_name().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_antialiasing_cache_init().
GPUShader* workbench_shader_antialiasing_get | ( | int | stage | ) |
Definition at line 298 of file workbench_shader.cc.
References BLI_assert, e_data, GPU_shader_create_from_info_name(), stage, and std::to_string().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_antialiasing_cache_init().
Definition at line 241 of file workbench_shader.cc.
References BLI_assert, e_data, and GPU_shader_create_from_info_name().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_cavity_cache_init().
GPUShader* workbench_shader_composite_get | ( | WORKBENCH_PrivateData * | wpd | ) |
Definition at line 183 of file workbench_shader.cc.
References BLI_assert, e_data, GPU_shader_create_from_info_name(), View3DShading::light, MAX_LIGHTING, WORKBENCH_PrivateData::shading, and workbench_lighting_mode_to_str().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_opaque_cache_init().
void workbench_shader_depth_of_field_get | ( | GPUShader ** | prepare_sh, |
GPUShader ** | downsample_sh, | ||
GPUShader ** | blur1_sh, | ||
GPUShader ** | blur2_sh, | ||
GPUShader ** | resolve_sh | ||
) |
Definition at line 263 of file workbench_shader.cc.
References downsample_sh, e_data, and GPU_shader_create_from_info_name().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_dof_cache_init().
Definition at line 335 of file workbench_shader.cc.
References ARRAY_SIZE, DRW_SHADER_FREE_SAFE, and e_data.
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_engine_free().
GPUShader* workbench_shader_merge_infront_get | ( | WORKBENCH_PrivateData * | wpd | ) |
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_opaque_cache_init().
GPUShader* workbench_shader_opaque_get | ( | WORKBENCH_PrivateData * | wpd, |
eWORKBENCH_DataType | data | ||
) |
Definition at line 158 of file workbench_shader.cc.
References workbench_shader_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_opaque_cache_init().
GPUShader* workbench_shader_opaque_image_get | ( | WORKBENCH_PrivateData * | wpd, |
eWORKBENCH_DataType | data, | ||
bool | tiled | ||
) |
Definition at line 163 of file workbench_shader.cc.
References workbench_shader_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_opaque_cache_init().
Definition at line 255 of file workbench_shader.cc.
References e_data, and GPU_shader_create_from_info_name().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_outline_cache_init().
Definition at line 236 of file workbench_shader.cc.
References workbench_shader_shadow_pass_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_shadow_cache_init().
Definition at line 231 of file workbench_shader.cc.
References workbench_shader_shadow_pass_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_shadow_cache_init().
GPUShader* workbench_shader_transparent_get | ( | WORKBENCH_PrivateData * | wpd, |
eWORKBENCH_DataType | data | ||
) |
Definition at line 170 of file workbench_shader.cc.
References workbench_shader_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_transparent_cache_init().
GPUShader* workbench_shader_transparent_image_get | ( | WORKBENCH_PrivateData * | wpd, |
eWORKBENCH_DataType | data, | ||
bool | tiled | ||
) |
Definition at line 176 of file workbench_shader.cc.
References workbench_shader_get_ex().
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_transparent_cache_init().
GPUShader* workbench_shader_transparent_resolve_get | ( | WORKBENCH_PrivateData * | wpd | ) |
Referenced by blender::draw::test_workbench_glsl_shaders(), and workbench_transparent_cache_init().
GPUShader* workbench_shader_volume_get | ( | bool | slice, |
bool | coba, | ||
eWORKBENCH_VolumeInterpType | interp_type, | ||
bool | smoke | ||
) |
Definition at line 311 of file workbench_shader.cc.
References e_data, GPU_shader_create_from_info_name(), and workbench_volume_interp_to_str().
Referenced by blender::draw::test_workbench_glsl_shaders(), workbench_volume_modifier_cache_populate(), and workbench_volume_object_cache_populate().
void workbench_shadow_cache_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 125 of file workbench_shadow.c.
References data, DRW_PASS_CREATE, DRW_shgroup_create(), DRW_shgroup_stencil_mask(), DRW_STATE_BLEND_ADD_FULL, DRW_STATE_DEPTH_GREATER_EQUAL, DRW_STATE_DEPTH_LESS, DRW_STATE_STENCIL_ALWAYS, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_STENCIL_SHADOW_FAIL, DRW_STATE_WRITE_STENCIL_SHADOW_PASS, NULL, sh, SHADOW_ENABLED, WORKBENCH_PrivateData::shadow_fail_caps_grp, WORKBENCH_PrivateData::shadow_fail_grp, WORKBENCH_PrivateData::shadow_pass_grp, WORKBENCH_PassList::shadow_ps, state, workbench_shader_shadow_fail_get(), workbench_shader_shadow_pass_get(), and workbench_shadow_update().
Referenced by workbench_cache_init().
void workbench_shadow_cache_populate | ( | WORKBENCH_Data * | data, |
Object * | ob, | ||
bool | has_transp_mat | ||
) |
Definition at line 292 of file workbench_shadow.c.
References WORKBENCH_PrivateData::cull_state, data, draw_engine_workbench, DRW_cache_object_edge_detection_get(), DRW_cache_object_surface_get(), DRW_debug_bbox(), DRW_drawdata_ensure(), DRW_shgroup_call_no_cull, DRW_shgroup_create_sub(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_vec3(), GPUBatch, Object::id, Object::imat, mul_v3_mat3_m4v3(), NULL, WORKBENCH_ObjectData::shadow_bbox, WORKBENCH_ObjectData::shadow_dir, WORKBENCH_PrivateData::shadow_direction_ws, WORKBENCH_PrivateData::shadow_fail_caps_grp, WORKBENCH_PrivateData::shadow_fail_grp, WORKBENCH_PrivateData::shadow_pass_grp, workbench_init_object_data(), workbench_shadow_camera_in_object_shadow(), workbench_shadow_object_cast_visible_shadow(), and workbench_shadow_object_shadow_distance().
Referenced by workbench_cache_populate().
void workbench_shadow_data_update | ( | WORKBENCH_PrivateData * | wpd, |
WORKBENCH_UBO_World * | wd | ||
) |
Definition at line 93 of file workbench_shadow.c.
References clamp_f(), copy_v3_v3(), Scene::display, DRW_context_state_get(), DRW_view_viewmat_get(), SceneDisplay::light_direction, mul_v3_mat3_m4v3(), NULL, scene, DRWContextState::scene, WORKBENCH_PrivateData::shading, WORKBENCH_UBO_World::shadow_add, WORKBENCH_UBO_World::shadow_direction_vs, WORKBENCH_PrivateData::shadow_direction_ws, SHADOW_ENABLED, WORKBENCH_UBO_World::shadow_focus, SceneDisplay::shadow_focus, View3DShading::shadow_intensity, WORKBENCH_UBO_World::shadow_mul, WORKBENCH_UBO_World::shadow_shift, SceneDisplay::shadow_shift, and SWAP.
Referenced by workbench_update_world_ubo().
void workbench_transparent_cache_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 69 of file workbench_transparent.c.
References WORKBENCH_PrivateData::accum_buffer_tx, BLI_ghash_ptr_new(), WORKBENCH_PrivateData::clip_state, WORKBENCH_Prepass::common_shgrp, WORKBENCH_PrivateData::cull_state, data, DRW_pass_create(), DRW_PASS_CREATE, DRW_PASS_INSTANCE_CREATE, DRW_shgroup_call_procedural_triangles(), DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_STATE_BLEND_ALPHA, DRW_STATE_BLEND_OIT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, WORKBENCH_Prepass::image_shgrp, WORKBENCH_Prepass::image_tiled_shgrp, WORKBENCH_Prepass::material_hash, WORKBENCH_PrivateData::material_ubo_curr, NULL, WORKBENCH_PrivateData::prepass, WORKBENCH_Data::psl, WORKBENCH_PrivateData::reveal_buffer_tx, sh, state, WORKBENCH_Data::stl, WORKBENCH_PassList::transp_accum_infront_ps, WORKBENCH_PassList::transp_accum_ps, WORKBENCH_PassList::transp_depth_infront_ps, WORKBENCH_PassList::transp_depth_ps, WORKBENCH_PassList::transp_resolve_ps, WORKBENCH_Prepass::vcol_shgrp, WORKBENCH_DATATYPE_MAX, workbench_shader_transparent_get(), workbench_shader_transparent_image_get(), workbench_shader_transparent_resolve_get(), workbench_transparent_lighting_uniforms(), and WORKBENCH_StorageList::wpd.
Referenced by workbench_cache_init().
void workbench_transparent_draw_depth_pass | ( | WORKBENCH_Data * | data | ) |
Redraw the transparent passes but with depth test to output correct outline IDs and depth.
Definition at line 137 of file workbench_transparent.c.
References data, WORKBENCH_PrivateData::dof_enabled, DRW_draw_pass(), DRW_pass_is_empty(), GPU_framebuffer_bind(), WORKBENCH_FramebufferList::opaque_fb, WORKBENCH_FramebufferList::opaque_infront_fb, WORKBENCH_PassList::outline_ps, WORKBENCH_PassList::transp_depth_infront_ps, WORKBENCH_PassList::transp_depth_ps, XRAY_ALPHA, and XRAY_FLAG_ENABLED.
Referenced by workbench_draw_sample().
void workbench_transparent_engine_init | ( | WORKBENCH_Data * | data | ) |
Definition at line 26 of file workbench_transparent.c.
References WORKBENCH_PrivateData::accum_buffer_tx, data, DRW_texture_pool_query_fullscreen(), DRW_viewport_texture_list_get(), GPU_RG16F, GPU_RGBA16F, GPU_RGBA32F, NORMAL_ENCODING_ENABLED, WORKBENCH_PrivateData::reveal_buffer_tx, WORKBENCH_FramebufferList::transp_accum_fb, and workbench_transparent_engine_init().
Referenced by workbench_engine_init(), and workbench_transparent_engine_init().
void workbench_update_material_ubos | ( | WORKBENCH_PrivateData * | wpd | ) |
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().
void workbench_volume_cache_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 41 of file workbench_volume.c.
References DRW_pass_create(), DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_CULL_FRONT, DRW_STATE_WRITE_COLOR, WORKBENCH_Data::psl, WORKBENCH_Data::stl, WORKBENCH_PassList::volume_ps, WORKBENCH_PrivateData::volumes_do, and WORKBENCH_StorageList::wpd.
Referenced by workbench_cache_init().
void workbench_volume_cache_populate | ( | WORKBENCH_Data * | vedata, |
struct Scene * | scene, | ||
struct Object * | ob, | ||
struct ModifierData * | md, | ||
eV3DShadingColorType | color_type | ||
) |
Referenced by workbench_cache_populate().
void workbench_volume_draw_pass | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 324 of file workbench_volume.c.
References DefaultFramebufferList::color_only_fb, DRW_draw_pass(), DRW_viewport_framebuffer_list_get(), GPU_framebuffer_bind(), WORKBENCH_Data::psl, WORKBENCH_Data::stl, WORKBENCH_PassList::volume_ps, WORKBENCH_PrivateData::volumes_do, and WORKBENCH_StorageList::wpd.
Referenced by workbench_draw_sample().
void workbench_volume_engine_init | ( | WORKBENCH_Data * | vedata | ) |
Definition at line 26 of file workbench_volume.c.
References WORKBENCH_TextureList::dummy_coba_tx, WORKBENCH_TextureList::dummy_shadow_tx, WORKBENCH_TextureList::dummy_volume_tx, GPU_DATA_FLOAT, GPU_RGBA8, GPU_texture_create_1d(), GPU_texture_create_3d(), NULL, and WORKBENCH_Data::txl.
Referenced by workbench_engine_init().
|
extern |
Definition at line 652 of file workbench_engine.c.
Referenced by workbench_dof_engine_init(), workbench_engine_init(), workbench_id_update(), and workbench_shadow_cache_populate().