Hello everyone!
I don't think this is a bug with godot, So I post it here for help!
In my project, I need to get the position of each instance in shader to do some computation.
I have tried NODE_POSITION_WORLD and VERTEX.
The NODE_POSITION_WORLD can get the position of the MultiMeshInstance node. All the instances have the same value!
shader_type spatial;
//render_mode world_vertex_coords;
void fragment() {
ALBEDO = NODE_POSITION_WORLD.xyz;
}
Image:
And VERTEX looks like it would return the position of each pixel in view space.
shader_type spatial;
//render_mode world_vertex_coords;
void fragment() {
ALBEDO = VERTEX.xyz;
}
Image:
Is there a way to get the position of each instance in MultiMeshInstance at fragment()?