mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 04:16:50 +01:00
257 lines
8.4 KiB
XML
257 lines
8.4 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="VertexLights3DServer" inherits="Object" version="4.3">
|
|
<brief_description>
|
|
A server that provides a way to store static lights that can be used to bake lighting information into mesh vertex data, or [SpatialMaterial]'s albedo modulation.
|
|
</brief_description>
|
|
<description>
|
|
A server that provides a way to store static lights that can be used to bake lighting information into mesh vertex data, or [SpatialMaterial]'s albedo 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 albedo color in your shader, or you can bake vertex colors of your meshes.
|
|
The drawback of this method is that it's more expensive change lights.
|
|
Note that you can use the normal 3D lighting system on top of this if you need dynamic lights (like [OmniLight]). That system is better suited for that purpose.
|
|
Currently this class stores lights inside octants. Their optimal size should be a bit more than the radius of the biggest light you want to have.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="flush_notifications">
|
|
<return type="void" />
|
|
<description>
|
|
Flushes map changed notifications. This will get called automatically.
|
|
</description>
|
|
</method>
|
|
<method name="free">
|
|
<return type="void" />
|
|
<argument index="0" name="rid" type="RID" />
|
|
<description>
|
|
Frees an allocated resource.
|
|
</description>
|
|
</method>
|
|
<method name="get_default_octant_size" qualifiers="const">
|
|
<return type="Vector3i" />
|
|
<description>
|
|
Get the default internal octant size.
|
|
</description>
|
|
</method>
|
|
<method name="light_create">
|
|
<return type="RID" />
|
|
<description>
|
|
Create a light.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_attenuation">
|
|
<return type="float" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's attenuation property.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_color">
|
|
<return type="Color" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's color property.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_is_enabled">
|
|
<return type="bool" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's enabled property.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_item_cull_mask">
|
|
<return type="int" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's item cull mask property.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_map">
|
|
<return type="RID" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's map.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_mode">
|
|
<return type="int" enum="VertexLights3DServer.VertexLight3DMode" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's mix mode.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_position">
|
|
<return type="Vector3" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's position.
|
|
</description>
|
|
</method>
|
|
<method name="light_get_range">
|
|
<return type="float" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<description>
|
|
Get a light's range.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_attenuation">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="attenuation" type="float" />
|
|
<description>
|
|
Set a light's attenuation property.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_color">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="color" type="Color" />
|
|
<description>
|
|
Set a light's color property.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_enabled">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="enabled" type="bool" />
|
|
<description>
|
|
Set a light's enabled property.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_item_cull_mask">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="item_cull_mask" type="int" />
|
|
<description>
|
|
Set a light's item cull mask property.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_map">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="map" type="RID" />
|
|
<description>
|
|
Set a light's map.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_mode">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="mode" type="int" enum="VertexLights3DServer.VertexLight3DMode" />
|
|
<description>
|
|
Set a light's mix mode.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_position">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="position" type="Vector3" />
|
|
<description>
|
|
Set a light's position.
|
|
</description>
|
|
</method>
|
|
<method name="light_set_range">
|
|
<return type="void" />
|
|
<argument index="0" name="light" type="RID" />
|
|
<argument index="1" name="range" type="float" />
|
|
<description>
|
|
Set a light's range.
|
|
</description>
|
|
</method>
|
|
<method name="map_clear">
|
|
<return type="void" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<description>
|
|
Clears a map of all lights.
|
|
</description>
|
|
</method>
|
|
<method name="map_create">
|
|
<return type="RID" />
|
|
<description>
|
|
Creates a map.
|
|
</description>
|
|
</method>
|
|
<method name="map_get_base_color" qualifiers="const">
|
|
<return type="Color" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<description>
|
|
Returns the base color of a map.
|
|
</description>
|
|
</method>
|
|
<method name="map_get_lights" qualifiers="const">
|
|
<return type="Array" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<description>
|
|
Returns all lights in a map.
|
|
</description>
|
|
</method>
|
|
<method name="map_get_octant_size" qualifiers="const">
|
|
<return type="Vector3i" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<description>
|
|
Returns a map's octant size.
|
|
</description>
|
|
</method>
|
|
<method name="map_set_base_color">
|
|
<return type="void" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<argument index="1" name="base_color" type="Color" />
|
|
<description>
|
|
Sets the base color of a map.
|
|
</description>
|
|
</method>
|
|
<method name="map_set_octant_size">
|
|
<return type="void" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<argument index="1" name="size" type="Vector3i" />
|
|
<description>
|
|
</description>
|
|
</method>
|
|
<method name="sample_light">
|
|
<return type="Color" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<argument index="1" name="position" type="Vector3" />
|
|
<argument index="2" name="normal" type="Vector3" />
|
|
<argument index="3" name="item_cull_mask" type="int" default="1" />
|
|
<description>
|
|
Sample the lighing information at a specific position with the specified normal.
|
|
</description>
|
|
</method>
|
|
<method name="sample_light_value">
|
|
<return type="Color" />
|
|
<argument index="0" name="map" type="RID" />
|
|
<argument index="1" name="position" type="Vector3" />
|
|
<argument index="2" name="item_cull_mask" type="int" default="1" />
|
|
<description>
|
|
Sample the lighing information at a specific position.
|
|
</description>
|
|
</method>
|
|
<method name="set_default_octant_size">
|
|
<return type="void" />
|
|
<argument index="0" name="size" type="Vector3i" />
|
|
<description>
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<signals>
|
|
<signal name="map_changed">
|
|
<argument index="0" name="map" type="RID" />
|
|
<description>
|
|
Emitted after a map changed (only once per frame).
|
|
</description>
|
|
</signal>
|
|
</signals>
|
|
<constants>
|
|
<constant name="VERTEX_LIGHT_3D_MODE_ADD" value="0" enum="VertexLight3DMode">
|
|
The light's color gets added to the resulting colors.
|
|
</constant>
|
|
<constant name="VERTEX_LIGHT_3D_MODE_SUB" value="1" enum="VertexLight3DMode">
|
|
The light's color gets substracted to the resulting colors.
|
|
</constant>
|
|
<constant name="VERTEX_LIGHT_3D_MODE_MIX" value="2" enum="VertexLight3DMode">
|
|
The light's color gets blended with the resulting colors.
|
|
</constant>
|
|
</constants>
|
|
</class>
|