mirror of
https://github.com/godotengine/godot.git
synced 2024-12-15 10:12:40 +08:00
33 lines
2.1 KiB
XML
33 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="CurveTexture" inherits="Texture2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
A 1D texture where pixel brightness corresponds to points on a curve.
|
|
</brief_description>
|
|
<description>
|
|
A 1D texture where pixel brightness corresponds to points on a [Curve] resource, either in grayscale or in red. This visual representation simplifies the task of saving curves as image files.
|
|
If you need to store up to 3 curves within a single texture, use [CurveXYZTexture] instead. See also [GradientTexture1D] and [GradientTexture2D].
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<members>
|
|
<member name="curve" type="Curve" setter="set_curve" getter="get_curve">
|
|
The [Curve] that is rendered onto the texture.
|
|
</member>
|
|
<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
|
|
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0">
|
|
The format the texture should be generated with. When passing a CurveTexture as an input to a [Shader], this may need to be adjusted.
|
|
</member>
|
|
<member name="width" type="int" setter="set_width" getter="get_width" default="256">
|
|
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.
|
|
</member>
|
|
</members>
|
|
<constants>
|
|
<constant name="TEXTURE_MODE_RGB" value="0" enum="TextureMode">
|
|
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.
|
|
</constant>
|
|
<constant name="TEXTURE_MODE_RED" value="1" enum="TextureMode">
|
|
Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this.
|
|
</constant>
|
|
</constants>
|
|
</class>
|