summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_scene_render.cpp
diff options
context:
space:
mode:
authorNumbuhFour <francesco.thefourth@gmail.com>2022-10-12 19:33:06 -0700
committerNumbuhFour <francesco.thefourth@gmail.com>2022-12-03 22:41:27 -0800
commit1b09fd5410d313a422fa37ce7eff53daea7bf6a3 (patch)
treeb92bf0397c3d255c942ffb8fa5423d76ddb8fe09 /servers/rendering/renderer_scene_render.cpp
parent015dc492de33a41eaeb14c0503a6be10466fe457 (diff)
Implement CAMERA_VISIBLE_LAYERS as built-in shader variable
Diffstat (limited to 'servers/rendering/renderer_scene_render.cpp')
-rw-r--r--servers/rendering/renderer_scene_render.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/renderer_scene_render.cpp b/servers/rendering/renderer_scene_render.cpp
index f085168df3..3c069f6e2e 100644
--- a/servers/rendering/renderer_scene_render.cpp
+++ b/servers/rendering/renderer_scene_render.cpp
@@ -33,7 +33,7 @@
/////////////////////////////////////////////////////////////////////////////
// CameraData
-void RendererSceneRender::CameraData::set_camera(const Transform3D p_transform, const Projection p_projection, bool p_is_orthogonal, bool p_vaspect, const Vector2 &p_taa_jitter) {
+void RendererSceneRender::CameraData::set_camera(const Transform3D p_transform, const Projection p_projection, bool p_is_orthogonal, bool p_vaspect, const Vector2 &p_taa_jitter, const uint32_t p_visible_layers) {
view_count = 1;
is_orthogonal = p_is_orthogonal;
vaspect = p_vaspect;
@@ -41,6 +41,7 @@ void RendererSceneRender::CameraData::set_camera(const Transform3D p_transform,
main_transform = p_transform;
main_projection = p_projection;
+ visible_layers = p_visible_layers;
view_offset[0] = Transform3D();
view_projection[0] = p_projection;
taa_jitter = p_taa_jitter;
@@ -49,6 +50,7 @@ void RendererSceneRender::CameraData::set_camera(const Transform3D p_transform,
void RendererSceneRender::CameraData::set_multiview_camera(uint32_t p_view_count, const Transform3D *p_transforms, const Projection *p_projections, bool p_is_orthogonal, bool p_vaspect) {
ERR_FAIL_COND_MSG(p_view_count != 2, "Incorrect view count for stereoscopic view");
+ visible_layers = 0xFFFFFFFF;
view_count = p_view_count;
is_orthogonal = p_is_orthogonal;
vaspect = p_vaspect;