Decrease the default GradientTexture and CurveTexture size

This provides better usability when a GradientTexture or CurveTexture
is added to a Control node.

Visual appearance of most GradientTextures and CurveTextures will
be unaffected.
This commit is contained in:
Hugo Locurcio 2022-01-29 00:28:10 +01:00
parent ffa566c770
commit b4f0d4c7db
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
4 changed files with 6 additions and 6 deletions

View file

@ -14,7 +14,7 @@
</member> </member>
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0"> <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="CurveTexture.TextureMode" default="0">
</member> </member>
<member name="width" type="int" setter="set_width" getter="get_width" default="2048"> <member name="width" type="int" setter="set_width" getter="get_width" default="256">
The width of the texture. The width of the texture.
</member> </member>
</members> </members>

View file

@ -13,7 +13,7 @@
</member> </member>
<member name="curve_z" type="Curve" setter="set_curve_z" getter="get_curve_z"> <member name="curve_z" type="Curve" setter="set_curve_z" getter="get_curve_z">
</member> </member>
<member name="width" type="int" setter="set_width" getter="get_width" default="2048"> <member name="width" type="int" setter="set_width" getter="get_width" default="256">
</member> </member>
</members> </members>
</class> </class>

View file

@ -15,7 +15,7 @@
<member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false"> <member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false">
If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format). If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
</member> </member>
<member name="width" type="int" setter="set_width" getter="get_width" default="2048"> <member name="width" type="int" setter="set_width" getter="get_width" default="256">
The number of color samples that will be obtained from the [Gradient]. The number of color samples that will be obtained from the [Gradient].
</member> </member>
</members> </members>

View file

@ -595,7 +595,7 @@ public:
private: private:
mutable RID _texture; mutable RID _texture;
Ref<Curve> _curve; Ref<Curve> _curve;
int _width = 2048; int _width = 256;
int _current_width = 0; int _current_width = 0;
TextureMode texture_mode = TEXTURE_MODE_RGB; TextureMode texture_mode = TEXTURE_MODE_RGB;
TextureMode _current_texture_mode = TEXTURE_MODE_RGB; TextureMode _current_texture_mode = TEXTURE_MODE_RGB;
@ -637,7 +637,7 @@ private:
Ref<Curve> _curve_x; Ref<Curve> _curve_x;
Ref<Curve> _curve_y; Ref<Curve> _curve_y;
Ref<Curve> _curve_z; Ref<Curve> _curve_z;
int _width = 2048; int _width = 256;
int _current_width = 0; int _current_width = 0;
void _update(); void _update();
@ -685,7 +685,7 @@ private:
Ref<Gradient> gradient; Ref<Gradient> gradient;
bool update_pending = false; bool update_pending = false;
RID texture; RID texture;
int width = 2048; int width = 256;
bool use_hdr = false; bool use_hdr = false;
void _queue_update(); void _queue_update();