diff options
Diffstat (limited to 'scene/3d/reflection_probe.h')
-rw-r--r-- | scene/3d/reflection_probe.h | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index 3867d13435..d1b9b12f65 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.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 */ @@ -32,9 +32,6 @@ #define REFLECTIONPROBE_H #include "scene/3d/visual_instance_3d.h" -#include "scene/resources/sky.h" -#include "scene/resources/texture.h" -#include "servers/rendering_server.h" class ReflectionProbe : public VisualInstance3D { GDCLASS(ReflectionProbe, VisualInstance3D); @@ -45,35 +42,45 @@ public: UPDATE_ALWAYS, }; + enum AmbientMode { + AMBIENT_DISABLED, + AMBIENT_ENVIRONMENT, + AMBIENT_COLOR + }; + private: RID probe; - float intensity; - float max_distance; - Vector3 extents; - Vector3 origin_offset; - bool box_projection; - bool enable_shadows; - bool interior; - Color interior_ambient; - float interior_ambient_energy; - float interior_ambient_probe_contribution; - - uint32_t cull_mask; - UpdateMode update_mode; + float intensity = 1.0; + float max_distance = 0.0; + Vector3 extents = Vector3(10, 10, 10); + Vector3 origin_offset = Vector3(0, 0, 0); + bool box_projection = false; + bool enable_shadows = false; + bool interior = false; + AmbientMode ambient_mode = AMBIENT_ENVIRONMENT; + Color ambient_color = Color(0, 0, 0); + float ambient_color_energy = 1.0; + float lod_threshold = 1.0; + + uint32_t cull_mask = (1 << 20) - 1; + UpdateMode update_mode = UPDATE_ONCE; protected: static void _bind_methods(); - void _validate_property(PropertyInfo &property) const; + void _validate_property(PropertyInfo &property) const override; public: void set_intensity(float p_intensity); float get_intensity() const; - void set_interior_ambient(Color p_ambient); - Color get_interior_ambient() const; + void set_ambient_mode(AmbientMode p_mode); + AmbientMode get_ambient_mode() const; - void set_interior_ambient_energy(float p_energy); - float get_interior_ambient_energy() const; + void set_ambient_color(Color p_ambient); + Color get_ambient_color() const; + + void set_ambient_color_energy(float p_energy); + float get_ambient_color_energy() const; void set_interior_ambient_probe_contribution(float p_contribution); float get_interior_ambient_probe_contribution() const; @@ -81,6 +88,9 @@ public: void set_max_distance(float p_distance); float get_max_distance() const; + void set_lod_threshold(float p_pixels); + float get_lod_threshold() const; + void set_extents(const Vector3 &p_extents); Vector3 get_extents() const; @@ -102,13 +112,14 @@ public: void set_update_mode(UpdateMode p_mode); UpdateMode get_update_mode() const; - virtual AABB get_aabb() const; - virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual AABB get_aabb() const override; + virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const override; ReflectionProbe(); ~ReflectionProbe(); }; +VARIANT_ENUM_CAST(ReflectionProbe::AmbientMode); VARIANT_ENUM_CAST(ReflectionProbe::UpdateMode); #endif // REFLECTIONPROBE_H |