diff options
author | Marius Hanl <mariushanl@web.de> | 2022-07-12 08:43:01 +0100 |
---|---|---|
committer | Marius Hanl <mariushanl@web.de> | 2023-01-31 20:04:11 +0100 |
commit | a59819630dcdb6dc9680b273d8a77267ea660e96 (patch) | |
tree | 27b8fc4d8711e98ee1038e3cd5a2ef659c01f1ca /servers/rendering/renderer_rd/forward_clustered | |
parent | e93266b9ff359c98e9f8e2a550e16ad77490fc4d (diff) |
Replace Extents with Size in VoxelGI, ReflectionProbe, FogVolume, Decal and GPUParticles*3D
- Extents are replaced by Size (Size is Extents * 2)
- The UI text displays 'Size'
- Snapping is adjusted to work with Size
- _set and _get handle extents for compatibility
Co-authored-by: ator-dev <dominic.codedeveloper@gmail.com>
Diffstat (limited to 'servers/rendering/renderer_rd/forward_clustered')
-rw-r--r-- | servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp | 20 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index ad63d3fd4b..c440765b33 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1232,9 +1232,9 @@ void RenderForwardClustered::_update_volumetric_fog(Ref<RenderSceneBuffersRD> p_ /* Lighting */ -void RenderForwardClustered::setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_extents) { +void RenderForwardClustered::setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_size) { if (current_cluster_builder != nullptr) { - current_cluster_builder->add_box(ClusterBuilderRD::BOX_TYPE_REFLECTION_PROBE, p_transform, p_half_extents); + current_cluster_builder->add_box(ClusterBuilderRD::BOX_TYPE_REFLECTION_PROBE, p_transform, p_half_size); } } @@ -1244,9 +1244,9 @@ void RenderForwardClustered::setup_added_light(const RS::LightType p_type, const } } -void RenderForwardClustered::setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_extents) { +void RenderForwardClustered::setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_size) { if (current_cluster_builder != nullptr) { - current_cluster_builder->add_box(ClusterBuilderRD::BOX_TYPE_DECAL, p_transform, p_half_extents); + current_cluster_builder->add_box(ClusterBuilderRD::BOX_TYPE_DECAL, p_transform, p_half_size); } } @@ -2617,8 +2617,8 @@ void RenderForwardClustered::_render_sdfgi(Ref<RenderSceneBuffersRD> p_render_bu render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - Vector3 half_extents = p_bounds.size * 0.5; - Vector3 center = p_bounds.position + half_extents; + Vector3 half_size = p_bounds.size * 0.5; + Vector3 center = p_bounds.position + half_size; Vector<RID> sbs = { p_albedo_texture, @@ -2646,16 +2646,16 @@ void RenderForwardClustered::_render_sdfgi(Ref<RenderSceneBuffersRD> p_render_bu fb_size.x = p_size[right_axis]; fb_size.y = p_size[up_axis]; - scene_data.cam_transform.origin = center + axis * half_extents; + scene_data.cam_transform.origin = center + axis * half_size; scene_data.cam_transform.basis.set_column(0, right); scene_data.cam_transform.basis.set_column(1, up); scene_data.cam_transform.basis.set_column(2, axis); //print_line("pass: " + itos(i) + " xform " + scene_data.cam_transform); - float h_size = half_extents[right_axis]; - float v_size = half_extents[up_axis]; - float d_size = half_extents[i] * 2.0; + float h_size = half_size[right_axis]; + float v_size = half_size[up_axis]; + float d_size = half_size[i] * 2.0; scene_data.cam_projection.set_orthogonal(-h_size, h_size, -v_size, v_size, 0, d_size); //print_line("pass: " + itos(i) + " cam hsize: " + rtos(h_size) + " vsize: " + rtos(v_size) + " dsize " + rtos(d_size)); diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h index 9245f1b13a..8eb17ba6f4 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h @@ -640,9 +640,9 @@ public: RendererRD::SSEffects *get_ss_effects() { return ss_effects; } /* callback from updating our lighting UBOs, used to populate cluster builder */ - virtual void setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_extents) override; + virtual void setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_size) override; virtual void setup_added_light(const RS::LightType p_type, const Transform3D &p_transform, float p_radius, float p_spot_aperture) override; - virtual void setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_extents) override; + virtual void setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_size) override; virtual void base_uniforms_changed() override; _FORCE_INLINE_ virtual void update_uniform_sets() override { |