Blender
V3.3
|
#include "DRW_render.h"
#include "BLI_alloca.h"
#include "BKE_editmesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_particle.h"
#include "BKE_pbvh.h"
#include "DNA_curves_types.h"
#include "DNA_fluid_types.h"
#include "DNA_image_types.h"
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
#include "ED_paint.h"
#include "workbench_engine.h"
#include "workbench_private.h"
Go to the source code of this file.
Macros | |
#define | WORKBENCH_ENGINE "BLENDER_WORKBENCH" |
Variables | |
static const DrawEngineDataSize | workbench_data_size = DRW_VIEWPORT_DATA_SIZE(WORKBENCH_Data) |
DrawEngineType | draw_engine_workbench |
RenderEngineType | DRW_engine_viewport_workbench_type |
Workbench Engine:
Optimized engine to draw the working viewport with solid and transparent geometry.
Definition in file workbench_engine.c.
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH" |
Definition at line 35 of file workbench_engine.c.
|
static |
Definition at line 157 of file workbench_engine.c.
References DRW_cache_mesh_surface_sculptcolors_get(), DRW_cache_mesh_surface_texpaint_get(), DRW_cache_mesh_surface_vertpaint_get(), DRW_cache_object_material_count_get(), DRW_cache_object_surface_get(), ELEM, GPUBatch, Object::mode, NULL, OB_MODE_VERTEX_PAINT, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, workbench_material_setup, workbench_object_drawcall(), and workbench_object_surface_material_get().
Referenced by workbench_cache_populate().
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().
|
static |
Definition at line 202 of file workbench_engine.c.
References ImagePaintSettings::canvas, DRW_context_state_get(), DRW_shgroup_hair_create_sub(), GPU_SAMPLER_FILTER, IMAGEPAINT_INTERP_LINEAR, IMAGEPAINT_MODE_IMAGE, ToolSettings::imapaint, ImagePaintSettings::interp, ImagePaintSettings::mode, NULL, scene, DRWContextState::scene, state, Scene::toolsettings, workbench_image_hair_setup, and workbench_material_hair_setup.
Referenced by workbench_cache_populate().
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().
|
static |
Definition at line 94 of file workbench_engine.c.
References Object::actcol, BLI_array_alloca, DRW_cache_object_material_count_get(), DRW_shgroup_call_sculpt(), DRW_shgroup_call_sculpt_with_materials(), ELEM, NULL, V3D_SHADING_MATERIAL_COLOR, and workbench_material_setup.
Referenced by workbench_cache_populate().
|
static |
Definition at line 124 of file workbench_engine.c.
References ImagePaintSettings::canvas, DRW_cache_mesh_surface_texpaint_get(), DRW_cache_mesh_surface_texpaint_single_get(), DRW_cache_object_material_count_get(), DRW_context_state_get(), GPU_SAMPLER_FILTER, GPU_SAMPLER_REPEAT, GPUBatch, IMAGEPAINT_INTERP_LINEAR, IMAGEPAINT_MODE_IMAGE, ToolSettings::imapaint, ImagePaintSettings::interp, ImagePaintSettings::mode, NULL, scene, DRWContextState::scene, SET_FLAG_FROM_TEST, state, Scene::toolsettings, workbench_image_setup, and workbench_object_drawcall().
Referenced by workbench_cache_populate().
|
static |
Decide what color-type to draw the object with. In some cases it can be overwritten by workbench_material_setup().
Definition at line 248 of file workbench_engine.c.
References BKE_pbvh_is_drawing_set(), BKE_pbvh_type(), BKE_sculptsession_use_pbvh_draw(), C, CD_MLOOPUV, CD_PROP_BYTE_COLOR, CD_PROP_COLOR, View3DShading::color_type, WORKBENCH_PrivateData::ctx_mode, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CustomData_has_layer(), Object::data, DRW_context_state_get(), DRW_object_use_hide_faces(), DRW_state_is_image_render(), Object::dt, Object::dtx, ED_paint_shading_color_override(), DRWContextState::evil_C, NULL, OB_DRAW_NO_SHADOW_CAST, OB_MESH, OB_TEXTURE, DRWContextState::obact, ToolSettings::paint_mode, SculptSession::pbvh, PBVH_FACES, DRWContextState::rv3d, WORKBENCH_PrivateData::scene, Object::sculpt, WORKBENCH_PrivateData::shading, SHADOW_ENABLED, Scene::toolsettings, Object::type, DRWContextState::v3d, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_OBJECT_COLOR, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, workbench_mesh_get_loop_custom_data(), and workbench_mesh_get_vert_custom_data().
Referenced by workbench_cache_populate().
Definition at line 621 of file workbench_engine.c.
References DRW_view_set_active(), and NULL.
Referenced by workbench_draw_scene(), and workbench_render().
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 602 of file workbench_engine.c.
References DRW_state_is_opengl_render(), max_ii(), WORKBENCH_Data::stl, WORKBENCH_PrivateData::taa_sample, WORKBENCH_PrivateData::taa_sample_len, workbench_draw_finish(), workbench_draw_sample(), workbench_update_world_ubo(), and WORKBENCH_StorageList::wpd.
Definition at line 627 of file workbench_engine.c.
References workbench_shader_free().
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().
Definition at line 638 of file workbench_engine.c.
References WORKBENCH_ObjectData::dd, draw_engine_workbench, DRW_drawdata_get(), GS, id, ID_OB, ID_RECALC_ALL, ID::name, NULL, DrawData::recalc, and WORKBENCH_ObjectData::shadow_bbox_dirty.
|
static |
Definition at line 224 of file workbench_engine.c.
References BLI_assert, BMEditMesh::bm, Mesh::edit_mesh, BMesh::ldata, Mesh::ldata, ME_WRAPPER_TYPE_BMESH, mesh, NULL, Mesh::runtime, and Mesh_Runtime::wrapper_type.
Referenced by workbench_color_type_get().
|
static |
Definition at line 234 of file workbench_engine.c.
References BLI_assert, BMEditMesh::bm, Mesh::edit_mesh, ME_WRAPPER_TYPE_BMESH, mesh, NULL, Mesh::runtime, BMesh::vdata, Mesh::vdata, and Mesh_Runtime::wrapper_type.
Referenced by workbench_color_type_get().
BLI_INLINE void workbench_object_drawcall | ( | DRWShadingGroup * | grp, |
struct GPUBatch * | geom, | ||
Object * | ob | ||
) |
Definition at line 113 of file workbench_engine.c.
References DRW_shgroup_call, DRW_shgroup_call_instance_range(), OB_POINTCLOUD, and Object::type.
Referenced by workbench_cache_common_populate(), and workbench_cache_texpaint_populate().
Definition at line 85 of file workbench_engine.c.
References BLI_array_alloca, DRW_cache_object_material_count_get(), and DRW_cache_object_surface_material_get().
Referenced by workbench_cache_common_populate().
Definition at line 632 of file workbench_engine.c.
References data, and workbench_antialiasing_view_updated().
DrawEngineType draw_engine_workbench |
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().
RenderEngineType DRW_engine_viewport_workbench_type |
Definition at line 670 of file workbench_engine.c.
Referenced by drw_engines_enable_from_engine(), and DRW_engines_register().
|
static |
Definition at line 650 of file workbench_engine.c.