2

I'm trying to add a "sticker" on an equirectangular image.

The parameters I have are the angle of the sticker (yaw, pitch, roll), and its size in pixels, and the equirectangular image size (always a 2:1 ratio).

Example with this sticker (don't mind the background) :

enter image description here

If we put the sticker at the bottom of the sphere, the shader should be able to get something like this :

enter image description here

8
  • 2
    I suggest using raytracing. If I understand the wikipedia page on equirectangular projection correctly, you can easily get ray directions from image coordinates (ray_yaw = x / image_w * 2 * pi and ray_pitch = (y + image_h/2) / image_h * pi or something similar). Then for each ray you just need to find a point where (and if) it intersects your quad (the math should be relatively easy to google). Commented Mar 27, 2019 at 13:47
  • Shadertoy reference: shadertoy.com/view/MlfSz7 Commented Mar 28, 2019 at 9:33
  • @HolyBlackCat Thanks a lot I will have a look at ray tracing Commented Mar 28, 2019 at 13:20
  • @mlkn Thanks this link is very interesting. In the shader you linked, the image "covers" all the sphere, do you know how I could place the image at a certain place on the sphere, not on the whole object ? Commented Mar 28, 2019 at 13:23
  • when you know your sticker size and you want something simple you can experiment with texture projection on a sphere; created a little playground for experiment (hope it is useful) shadertoy.com/view/3dBSzy Commented Apr 1, 2019 at 18:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.