1
$\begingroup$

I have a sphere with an image texture that I would like to project to a cube, such that the texture will appear the exact same when viewed from 0,0,0 as seen below. (yes, they do need to be offset like that)

image description here

So far I've tried the data transfer modifier and texture baking, but neither worked.

$\endgroup$
2
  • 1
    $\begingroup$ Texture baking is what you're looking for. maybe if you gave us some more info about what "didn't work" meant when you tried it we could help debug it. $\endgroup$ Commented Sep 16 at 18:42
  • $\begingroup$ You can check in the blend file. I used "selected to active" both with and without a cage. You can see the results look all messed up. $\endgroup$ Commented Sep 16 at 19:14

2 Answers 2

3
+50
$\begingroup$

Approach 3 - Spherical Coordinates

Considering that the UV map of a standard UV sphere is just angles in a spherical coordinate system, we can take the spherical coordinates of the cube an simply ignore the radius.

This will work provided the origin of the cube is the center of the sphere and if the sphere UV map is unchanged. (In your case the UV map is rotated 90 degrees, so simply rotate the cube in the end or add 90 degrees to the XY angle)

Approach 3

Approach 1 - Copy UV with Raycast

A naive approach with geometry nodes (as you can see it doesn't deal very well with the seams).

Subdivides the cube and samples the UV from the sphere.
Then you can use the same material in both objects.

(Some black glitches here are due to my machine, not the method)

Raycast nodes

This approach works as long as both origins are coincident and the sphere origin is at the center of the sphere.

Approach 2 - Transform the sphere into the cube

Also with raycast, this deals perfectly with the seams, but leaves the cube edges a little jagged (minimized with subdividing the sphere).

You can then bake this refined cube into a regular cube.

Nodes 2

File with all approaches

$\endgroup$
5
  • $\begingroup$ The 2nd approach worked out perfectly for me, thank you very much! $\endgroup$ Commented Sep 19 at 17:23
  • $\begingroup$ @Geri, just thought of approach 3 which can be done entirely with shade nodes, no need to bake, no geometry change - Will post it later today. $\endgroup$ Commented Sep 19 at 18:09
  • $\begingroup$ Sounds great! Will wait for it before I implement the textures into my project. $\endgroup$ Commented Sep 19 at 18:10
  • $\begingroup$ @Geri, the new approach is done $\endgroup$ Commented Sep 19 at 22:03
  • $\begingroup$ Thank you! Works very well! $\endgroup$ Commented Sep 20 at 11:43
1
$\begingroup$

When baking, turn off Cage and raise your Extrusion and Max Ray Distance values.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for the answer, however your result is still not optimal, as you can see the baked texture doesn't fill the full texture, but it should. $\endgroup$ Commented Sep 18 at 11:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.