Blender
V3.3
|
#include "DRW_render.h"
#include "ED_view3d.h"
#include "workbench_engine.h"
#include "workbench_private.h"
Go to the source code of this file.
Transparent Pipeline:
Use Weight Blended Order Independent Transparency to render transparent surfaces.
The rendering is broken down in two passes:
An additional re-render of the transparent surfaces is sometime done in order to have their correct depth and object ids correctly written.
Definition in file workbench_transparent.c.
void workbench_transparent_cache_init | ( | WORKBENCH_Data * | vedata | ) |
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().
|
static |
Definition at line 50 of file workbench_transparent.c.
References BKE_studiolight_ensure_flag(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_texture(), StudioLightImage::gputexture, StudioLight::matcap_diffuse, StudioLight::matcap_specular, WORKBENCH_PrivateData::studio_light, STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE, STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE, STUDIOLIGHT_TYPE_MATCAP_ENABLED, workbench_is_specular_highlight_enabled(), and WORKBENCH_PrivateData::world_ubo.
Referenced by workbench_transparent_cache_init().