I am trying to draw geometry in 2D using VisualServer::get_singleton()->canvas_item_add_triangle_array, however I noticed that UVs are unusable in a shader unless you also specify a texture. That can be annoying if all you have is a procedural material that doesn't need a main texture. The workaround is then to put a dummy texture RID as an argument.
Is this subject to change in 3.0?
What's the status on this one for 3.0?
I don't think I understand it
On Sat, Jan 28, 2017 at 7:09 PM, Bojidar Marinov notifications@github.com
wrote:
What's the status on this one for 3.0?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7298#issuecomment-275878202,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2x1MJ9XBTVqST4Sq3Rw280UJOaQkks5rW7yDgaJpZM4LMck2
.
If there is no texture on the material of the thing you draw, using UVs doesn't work when using a custom shader.
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
It still happens in Godot 3.0.2, if you attempt to draw a polygon for example. If you make a shader that makes use of UVs but doesn't need a texture, it still won't draw anything.
extends Node2D
func _draw():
var points = PoolVector2Array()
points.append(Vector2(0,0))
points.append(Vector2(100,0))
points.append(Vector2(100,100))
points.append(Vector2(0,100))
var colors = PoolColorArray()
colors.append(Color(1,1,1,1))
colors.append(Color(1,1,1,1))
colors.append(Color(1,1,1,1))
colors.append(Color(1,1,1,1))
var uvs = PoolVector2Array()
uvs.append(Vector2(0,0))
uvs.append(Vector2(1,0))
uvs.append(Vector2(1,1))
uvs.append(Vector2(0,1))
draw_polygon(points, colors, uvs)
ERROR: VisualServerCanvas::canvas_item_add_polygon: Condition ' uv_size != 0 && (uv_size != pointcount || !p_texture.is_valid()) ' is true.
At: servers\visual\visual_server_canvas.cpp:668
I think shaders need a texture to work, try with a ColorFrame, shaders won't work without a texture on it.
@eon-s but my point is, main textures are useless when using a ShaderMaterial that doesn't use TEXTURE, and UVs should be accessible if the shader makes use of UV.
Cherry-picked for 3.0.7.
Most helpful comment
@eon-s but my point is, main textures are useless when using a ShaderMaterial that doesn't use
TEXTURE, and UVs should be accessible if the shader makes use ofUV.