summaryrefslogtreecommitdiff
path: root/servers/rendering_server.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-04-14 00:05:21 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-04-14 11:13:34 -0300
commit5944eb6e7f4fc6f2a2b3a88032e3195467a12915 (patch)
tree80e38590d93bdb7d7a1c98310c5cc8baa99d64ad /servers/rendering_server.h
parent451d5bd49217e4b55221032e67a7e682e20dad67 (diff)
Implement decals
Also implemented decal atlas, so projectors and other stuff can be added. Sidenote: Had to make RID hashable, so some unrelated includes changed in order to include it in hashfuncs.h
Diffstat (limited to 'servers/rendering_server.h')
-rw-r--r--servers/rendering_server.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/servers/rendering_server.h b/servers/rendering_server.h
index 1fd7a23d23..e090bcb451 100644
--- a/servers/rendering_server.h
+++ b/servers/rendering_server.h
@@ -461,6 +461,27 @@ public:
virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) = 0;
virtual void reflection_probe_set_resolution(RID p_probe, int p_resolution) = 0;
+ /* DECAL API */
+
+ enum DecalTexture {
+ DECAL_TEXTURE_ALBEDO,
+ DECAL_TEXTURE_NORMAL,
+ DECAL_TEXTURE_ORM,
+ DECAL_TEXTURE_EMISSION,
+ DECAL_TEXTURE_MAX
+ };
+
+ virtual RID decal_create() = 0;
+ virtual void decal_set_extents(RID p_decal, const Vector3 &p_extents) = 0;
+ virtual void decal_set_texture(RID p_decal, DecalTexture p_type, RID p_texture) = 0;
+ virtual void decal_set_emission_energy(RID p_decal, float p_energy) = 0;
+ virtual void decal_set_albedo_mix(RID p_decal, float p_mix) = 0;
+ virtual void decal_set_modulate(RID p_decal, const Color &p_modulate) = 0;
+ virtual void decal_set_cull_mask(RID p_decal, uint32_t p_layers) = 0;
+ virtual void decal_set_distance_fade(RID p_decal, bool p_enabled, float p_begin, float p_length) = 0;
+ virtual void decal_set_fade(RID p_decal, float p_above, float p_below) = 0;
+ virtual void decal_set_normal_fade(RID p_decal, float p_fade) = 0;
+
/* GI PROBE API */
virtual RID gi_probe_create() = 0;
@@ -673,6 +694,7 @@ public:
VIEWPORT_DEBUG_DRAW_SSAO,
VIEWPORT_DEBUG_DRAW_ROUGHNESS_LIMITER,
VIEWPORT_DEBUG_DRAW_PSSM_SPLITS,
+ VIEWPORT_DEBUG_DRAW_DECAL_ATLAS,
};
@@ -864,6 +886,7 @@ public:
INSTANCE_PARTICLES,
INSTANCE_LIGHT,
INSTANCE_REFLECTION_PROBE,
+ INSTANCE_DECAL,
INSTANCE_GI_PROBE,
INSTANCE_LIGHTMAP_CAPTURE,
INSTANCE_MAX,
@@ -1163,6 +1186,7 @@ VARIANT_ENUM_CAST(RenderingServer::LightOmniShadowMode);
VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowMode);
VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowDepthRangeMode);
VARIANT_ENUM_CAST(RenderingServer::ReflectionProbeUpdateMode);
+VARIANT_ENUM_CAST(RenderingServer::DecalTexture);
VARIANT_ENUM_CAST(RenderingServer::ParticlesDrawOrder);
VARIANT_ENUM_CAST(RenderingServer::ViewportUpdateMode);
VARIANT_ENUM_CAST(RenderingServer::ViewportClearMode);