#Get color of position on sphere
7 messages · Page 1 of 1 (latest)
I guess that I need the texture coordinate (UV) and then determine the color of the position from the texture
But I cant find a way to get the color form a UV
If you have an Image for the Texture you should be able to decode pixel values from the Image.data field.
How would you get the texture coordinate?
That is what I'm trying to figure out.
Its a uvsphere at 0.0, 0.0, 0.0 with a radius of 1. Using bevy_mod_racast I know the position of the mouse on the sphere.
I need to somehow translate the global raycast poition to the texture coordinate
I think it would be possible to use a shader for this. A post processing shader that also updates a storage buffer. Though I'm not quite clear on the details needed to make it work.