mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Update canvas_item_shader.rst
I tested it and it is upper left, not lower left.
This is the CanvasItem shader I used to test it:
shader_type canvas_item;
void fragment() {
if(distance(FRAGCOORD.xy, vec2(40, 40)) < 30.0)
COLOR = vec4(1,0,0,1);
else
COLOR = vec4(0,0,0,1);
}
(cherry picked from commit b71cec668a)
This commit is contained in:
committed by
Max Hilbrunner
parent
7df8fe736f
commit
4b8fbb8939
@@ -159,7 +159,7 @@ it to the ``NORMALMAP`` property. Godot will handle converting it for use in 2D
|
||||
| Built-in | Description |
|
||||
+=============================================+===============================================================+
|
||||
| in vec4 **FRAGCOORD** | Coordinate of pixel center. In screen space. ``xy`` specifies |
|
||||
| | position in window. Origin is lower-left. |
|
||||
| | position in window. Origin is upper-left. |
|
||||
+---------------------------------------------+---------------------------------------------------------------+
|
||||
| in vec2 **SCREEN_PIXEL_SIZE** | Size of individual pixels. Equal to inverse of resolution. |
|
||||
+---------------------------------------------+---------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user