Merge pull request #49337 from Chaosus/vs_texture_func

Adds `UVFunc` for panning/scaling on UV's to VisualShader's.
This commit is contained in:
Rémi Verschelde 2021-06-07 09:38:37 +02:00 committed by GitHub
commit afbabd12f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 274 additions and 0 deletions

View file

@ -9,6 +9,13 @@
<link title="VisualShaders">https://docs.godotengine.org/en/latest/tutorials/shading/visual_shaders.html</link>
</tutorials>
<methods>
<method name="clear_default_input_values">
<return type="void">
</return>
<description>
Clears the default input ports value.
</description>
</method>
<method name="get_default_input_values" qualifiers="const">
<return type="Array">
</return>
@ -25,6 +32,15 @@
Returns the default value of the input [code]port[/code].
</description>
</method>
<method name="remove_input_port_default_value">
<return type="void">
</return>
<argument index="0" name="port" type="int">
</argument>
<description>
Removes the default value of the input [code]port[/code].
</description>
</method>
<method name="set_default_input_values">
<return type="void">
</return>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeUVFunc" inherits="VisualShaderNode" version="4.0">
<brief_description>
Contains functions to modify texture coordinates ([code]uv[/code]) to be used within the visual shader graph.
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeUVFunc.Function" default="0">
A function to be applied to the texture coordinates. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_PANNING" value="0" enum="Function">
Translates [code]uv[/code] by using [code]scale[/code] and [code]offset[/code] values using the following formula: [code]uv = uv + offset * scale[/code]. [code]uv[/code] port is connected to [code]UV[/code] built-in by default.
</constant>
<constant name="FUNC_SCALING" value="1" enum="Function">
Scales [code]uv[/uv] by using [code]scale[/code] and [code]pivot[/code] values using the following formula: [code]uv = (uv - pivot) * scale + pivot[/code]. [code]uv[/code] port is connected to [code]UV[/code] built-in by default.
</constant>
<constant name="FUNC_MAX" value="2" enum="Function">
Represents the size of the [enum Function] enum.
</constant>
</constants>
</class>