summaryrefslogtreecommitdiff
path: root/scene/3d/visual_instance_3d.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/visual_instance_3d.h')
-rw-r--r--scene/3d/visual_instance_3d.h61
1 files changed, 37 insertions, 24 deletions
diff --git a/scene/3d/visual_instance_3d.h b/scene/3d/visual_instance_3d.h
index 195674f62d..8d24e13d47 100644
--- a/scene/3d/visual_instance_3d.h
+++ b/scene/3d/visual_instance_3d.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,10 +31,7 @@
#ifndef VISUAL_INSTANCE_H
#define VISUAL_INSTANCE_H
-#include "core/math/face3.h"
-#include "core/rid.h"
#include "scene/3d/node_3d.h"
-#include "scene/resources/material.h"
class VisualInstance3D : public Node3D {
GDCLASS(VisualInstance3D, Node3D);
@@ -42,7 +39,7 @@ class VisualInstance3D : public Node3D {
RID base;
RID instance;
- uint32_t layers;
+ uint32_t layers = 1;
RID _get_visual_instance_rid() const;
@@ -72,8 +69,8 @@ public:
void set_layer_mask(uint32_t p_mask);
uint32_t get_layer_mask() const;
- void set_layer_mask_bit(int p_layer, bool p_enable);
- bool get_layer_mask_bit(int p_layer) const;
+ void set_layer_mask_value(int p_layer_number, bool p_enable);
+ bool get_layer_mask_value(int p_layer_number) const;
VisualInstance3D();
~VisualInstance3D();
@@ -105,19 +102,25 @@ public:
};
private:
- ShadowCastingSetting shadow_casting_setting;
+ ShadowCastingSetting shadow_casting_setting = SHADOW_CASTING_SETTING_ON;
Ref<Material> material_override;
- float lod_min_distance;
- float lod_max_distance;
- float lod_min_hysteresis;
- float lod_max_hysteresis;
+
+ float visibility_range_begin = 0.0;
+ float visibility_range_end = 0.0;
+ float visibility_range_begin_margin = 0.0;
+ float visibility_range_end_margin = 0.0;
+
+ Vector<NodePath> visibility_range_children;
+
+ float lod_bias = 1.0;
mutable HashMap<StringName, Variant> instance_uniforms;
mutable HashMap<StringName, StringName> instance_uniform_property_remap;
- float extra_cull_margin;
- LightmapScale lightmap_scale;
- GIMode gi_mode;
+ float extra_cull_margin = 0.0;
+ LightmapScale lightmap_scale = LIGHTMAP_SCALE_1X;
+ GIMode gi_mode = GI_MODE_DISABLED;
+ bool ignore_occlusion_culling = false;
const StringName *_instance_uniform_get_remap(const StringName p_name) const;
@@ -133,17 +136,20 @@ public:
void set_cast_shadows_setting(ShadowCastingSetting p_shadow_casting_setting);
ShadowCastingSetting get_cast_shadows_setting() const;
- void set_lod_min_distance(float p_dist);
- float get_lod_min_distance() const;
+ void set_visibility_range_begin(float p_dist);
+ float get_visibility_range_begin() const;
- void set_lod_max_distance(float p_dist);
- float get_lod_max_distance() const;
+ void set_visibility_range_end(float p_dist);
+ float get_visibility_range_end() const;
- void set_lod_min_hysteresis(float p_dist);
- float get_lod_min_hysteresis() const;
+ void set_visibility_range_begin_margin(float p_dist);
+ float get_visibility_range_begin_margin() const;
- void set_lod_max_hysteresis(float p_dist);
- float get_lod_max_hysteresis() const;
+ void set_visibility_range_end_margin(float p_dist);
+ float get_visibility_range_end_margin() const;
+
+ void set_visibility_range_parent(const Node *p_parent);
+ void clear_visibility_range_parent();
void set_material_override(const Ref<Material> &p_material);
Ref<Material> get_material_override() const;
@@ -151,6 +157,9 @@ public:
void set_extra_cull_margin(float p_margin);
float get_extra_cull_margin() const;
+ void set_lod_bias(float p_bias);
+ float get_lod_bias() const;
+
void set_gi_mode(GIMode p_mode);
GIMode get_gi_mode() const;
@@ -162,6 +171,10 @@ public:
void set_custom_aabb(AABB aabb);
+ void set_ignore_occlusion_culling(bool p_enabled);
+ bool is_ignoring_occlusion_culling();
+
+ TypedArray<String> get_configuration_warnings() const override;
GeometryInstance3D();
};