#Get color of position on sphere

7 messages · Page 1 of 1 (latest)

vapid umbra
#

Hello, I'm curious to know how one could determine the color of a specific location on a 3D sphere using the mouse's position.

#

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

noble yoke
#

If you have an Image for the Texture you should be able to decode pixel values from the Image.data field.

eager nebula
#

How would you get the texture coordinate?

vapid umbra
#

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

eager nebula
#

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.