@@ -43,7 +43,7 @@ so long as it is drawing to the canvas, so for this tutorial we will use a Sprit
4343as it is the easiest CanvasItem to start drawing with.
4444
4545In the Inspector, click beside "Texture" where it says "[empty]" and select
46- "Load", then select "Icon.png ". For new projects, this is the Godot icon. You
46+ "Load", then select "icon.svg ". For new projects, this is the Godot icon. You
4747should now see the icon in the viewport.
4848
4949Next, look down in the Inspector, under the CanvasItem section, click beside
@@ -132,27 +132,27 @@ other functions or to assign values to ``COLOR`` directly.
132132Using ``TEXTURE `` built-in
133133^^^^^^^^^^^^^^^^^^^^^^^^^^
134134
135- When you want to adjust a color in a Sprite2D you cannot just adjust the color
135+ The default fragment function reads from the set Sprite2D texture and displays it.
136+
137+ When you want to adjust a color in a Sprite2D you can adjust the color
136138from the texture manually like in the code below.
137139
138140.. code-block :: glsl
139141
140142 void fragment(){
141- //this shader will result in an all white rectangle
143+ // This shader will result in a blue-tinted icon
142144 COLOR.b = 1.0;
143145 }
144146
145- The default fragment function reads from a texture and displays it. When you
146- overwrite the default fragment function, you lose that functionality, so you
147- have to implement it yourself. You read from textures using the ``texture ``
148- function. Certain nodes, like Sprite2Ds, have a dedicated texture variable that
149- can be accessed in the shader using ``TEXTURE ``. Use it together with ``UV `` and
150- ``texture `` to draw the Sprite2D.
147+ Certain nodes, like Sprite2Ds, have a dedicated texture variable that can be accessed
148+ in the shader using ``TEXTURE ``. If you want to use the Sprite2D texture to combine
149+ with other colors, you can use the ``UV `` with the ``texture `` function to access
150+ this variable. Use them to redraw the Sprite2D with the texture.
151151
152152.. code-block :: glsl
153153
154154 void fragment(){
155- COLOR = texture(TEXTURE, UV); //read from texture
155+ COLOR = texture(TEXTURE, UV); // Read from texture again.
156156 COLOR.b = 1.0; //set blue channel to 1.0
157157 }
158158
@@ -180,7 +180,7 @@ Add a uniform to change the amount of blue in our Sprite2D.
180180 uniform float blue = 1.0; // you can assign a default value to uniforms
181181
182182 void fragment(){
183- COLOR = texture(TEXTURE, UV); //read from texture
183+ COLOR = texture(TEXTURE, UV); // Read from texture
184184 COLOR.b = blue;
185185 }
186186
0 commit comments