0.2.0-dev Download ZIP
32 lines ·2.1 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CurveTexture" inherits="Texture2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A 1D texture where pixel brightness corresponds to points on a curve. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A 1D texture where pixel brightness corresponds to points on a unit [Curve] resource, either in grayscale or in red. This visual representation simplifies the task of saving curves as image files. |
| 8 | If you need to store up to 3 curves within a single texture, use [CurveXYZTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <members> |
| 13 | <member name="curve" type="Curve" setter="set_curve" getter="get_curve"> |
| 14 | The [Curve] that is rendered onto the texture. Should be a unit [Curve]. |
| 15 | </member> |
| 16 | <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" /> |
| 17 | <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0"> |
| 18 | The format the texture should be generated with. When passing a CurveTexture as an input to a [Shader], this may need to be adjusted. |
| 19 | </member> |
| 20 | <member name="width" type="int" setter="set_width" getter="get_width" default="256"> |
| 21 | The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. |
| 22 | </member> |
| 23 | </members> |
| 24 | <constants> |
| 25 | <constant name="TEXTURE_MODE_RGB" value="0" enum="TextureMode"> |
| 26 | Store the curve equally across the red, green and blue channels. This uses more video memory, but is more compatible with shaders that only read the green and blue values. |
| 27 | </constant> |
| 28 | <constant name="TEXTURE_MODE_RED" value="1" enum="TextureMode"> |
| 29 | Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this. |
| 30 | </constant> |
| 31 | </constants> |
| 32 | </class> |