From 7f5b9650d95bb0fa4fbf8428a9a9b3dc88300308 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 27 Mar 2024 08:58:40 +0100 Subject: [PATCH] Docs for the VertexLights2DServer. --- .../doc_classes/VertexLights2DServer.xml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/modules/vertex_lights_2d/doc_classes/VertexLights2DServer.xml b/modules/vertex_lights_2d/doc_classes/VertexLights2DServer.xml index 7b883e1cf..579e2ae2b 100644 --- a/modules/vertex_lights_2d/doc_classes/VertexLights2DServer.xml +++ b/modules/vertex_lights_2d/doc_classes/VertexLights2DServer.xml @@ -1,8 +1,15 @@ + A server that provides a way to store static lights that can be used to bake lighting information into mesh vertex data, or [CanvasItem]'s color modulation. + A server that provides a way to store static lights that can be used to bake lighting information into mesh vertex data, or [CanvasItem]'s color modulation. + With this class extremely complex light information can be stored and used with no additional cost on the GPU side. + After adding lights, you can use [member sample_light] to sample lighting at a specified point in the map's space, then use the resulting [Color] to either further modifty the modulate property of [CanvasItem]s, or you can render meshes using this color in you custom _draw methods. + The drawback of this method is that it's more expensive change lights. + Note that you can use the normal 2D lighting system on top of this if you need dynamic lights (like [Light2D]). That system is better suited for that purpose. + Currently this class stores lights inside quadrants. Their optimal size should be a bit more than the radius of the biggest light you want to have. @@ -10,82 +17,96 @@ + Flushes map changed notifications. This will get called automatically. + Frees an allocated resource. + Get the default internal quadrant size. + Create a light. + Get a light's attenuation property. + Get a light's color property. + Get a light's enabled property. + Get a light's item cull mask property. + Get a light's layer range property. + Get a light's map. + Get a light's mix mode. + Get a light's position. + Get a light's range. + Get a light's z range property. @@ -93,6 +114,7 @@ + Set a light's attenuation property. @@ -100,6 +122,7 @@ + Set a light's color property. @@ -107,6 +130,7 @@ + Set a light's enabled property. @@ -114,6 +138,7 @@ + Set a light's item cull mask property. @@ -121,6 +146,7 @@ + Set a light's layer range property. @@ -128,6 +154,7 @@ + Set a light's map. @@ -135,6 +162,7 @@ + Set a light's mix mode. @@ -142,6 +170,7 @@ + Set a light's position. @@ -149,6 +178,7 @@ + Set a light's range. @@ -156,35 +186,41 @@ + Set a light's z range property. + Clears a map of all lights. + Creates a map. + Returns the base color of a map. + Returns all lights in a map. + Returns a map's quadrant size. @@ -192,6 +228,7 @@ + Sets the base color of a map. @@ -199,6 +236,7 @@ + Sets a map's quadrant size. @@ -208,12 +246,14 @@ + Sample the lighing information at a specific position. + Set the default internal quadrant size. @@ -221,15 +261,19 @@ + Emitted after a map changed (only once per frame). + The light's color gets added to the resulting colors. + The light's color gets substracted to the resulting colors. + The light's color gets blended with the resulting colors.