25 if (view_is_below_plane) {
26 this->normal = -this->
normal;
42 update_probes_ = !inst_.
light_probes.planar_map_.is_empty();
50 do_display_draw_ =
false;
56 if (!update_probes_ && !inst_.
light_probes.planar_map_.is_empty()) {
68 int2 extent = main_view_extent;
69 int layer_count = num_probes;
71 if (num_probes == 0) {
84 int resource_index = 0;
85 int display_index = 0;
91 PlanarResources &res = resources_[resource_index];
95 probe.set_view(main_view, resource_index);
96 probe_planar_buf_[resource_index] = probe;
98 res.view.
sync(probe.viewmat, probe.winmat);
100 world_clip_buf_.
plane = probe.reflection_clip_plane_get();
118 res.view, depth_tx_.
layer_view(resource_index), res.gbuffer_fb, res.combined_fb, extent);
120 if (do_display_draw_ && probe.viewport_display) {
131 probe_planar_buf_[resource_index].layer_id = -1;
135 do_display_draw_ = display_index > 0;
136 if (do_display_draw_) {
137 display_data_buf_.
resize(display_index);
144 if (!do_display_draw_) {
148 viewport_display_ps_.
init();
158 viewport_display_ps_.
bind_ssbo(
"display_data_buf", display_data_buf_);
bool DEG_id_type_any_exists(const Depsgraph *depsgraph, short id_type)
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
btMatrix3x3 transpose() const
Return the transpose of the matrix.
SIMD_FORCE_INLINE btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
void ensure(GPUAttachment depth=GPU_ATTACHMENT_NONE, GPUAttachment color1=GPU_ATTACHMENT_NONE, GPUAttachment color2=GPU_ATTACHMENT_NONE, GPUAttachment color3=GPU_ATTACHMENT_NONE, GPUAttachment color4=GPU_ATTACHMENT_NONE, GPUAttachment color5=GPU_ATTACHMENT_NONE, GPUAttachment color6=GPU_ATTACHMENT_NONE, GPUAttachment color7=GPU_ATTACHMENT_NONE, GPUAttachment color8=GPU_ATTACHMENT_NONE)
void submit(PassSimple &pass, View &view)
void resize(int64_t new_size)
T & get_or_resize(int64_t index)
bool ensure_2d_array(eGPUTextureFormat format, int2 extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
bool ensure_layer_views(bool cube_as_array=false)
GPUTexture * layer_view(int layer)
const float4x4 & winmat(int view_id=0) const
const float4x4 & viewmat(int view_id=0) const
void sync(const float4x4 &view_mat, const float4x4 &win_mat, int view_id=0)
void bind_resources(U &resources)
void draw_procedural(GPUPrimType primitive, uint instance_len, uint vertex_len, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
void state_set(DRWState state, int clip_plane_count=0)
void framebuffer_set(GPUFrameBuffer **framebuffer)
void push_constant(const char *name, const float &data)
void bind_ssbo(const char *name, GPUStorageBuf *buffer)
void shader_set(GPUShader *shader)
int normal_layer_count() const
int closure_layer_count() const
SphereProbeModule sphere_probes
LightProbeModule light_probes
PlanarProbePipeline planar
DeferredPipeline deferred
void set_view(const draw::View &main_view, int2 main_view_extent)
void viewport_draw(View &view, GPUFrameBuffer *view_fb)
void render(View &view, GPUTexture *depth_layer_tx, Framebuffer &gbuffer, Framebuffer &combined_fb, int2 extent)
GPUShader * static_shader_get(eShaderType shader_type)
bool DRW_state_draw_support()
void DRW_viewport_request_redraw()
@ DRW_STATE_DEPTH_LESS_EQUAL
DOF_TILES_FLATTEN_GROUP_SIZE coc_tx GPU_R11F_G11F_B10F
MatBase< float, 3, 4 > float3x4
VecBase< int32_t, 2 > int2
void acquire(int2 extent, int data_count, int normal_count)
float3x4 world_to_object_transposed
void set_view(const draw::View &view, int layer_id)
SphereProbeUvArea atlas_coord