What are best practices for baking procedural materials to a UV sphere?

I searched Google and these forums for suggestions, but came up empty handed. Hopefully this isn’t a repeat topic.

I’ve been working on a set of procedural materials in Blender for planet textures. Here is a preview of some of them:

These are created with procedural nodes then baked at a 2:1 rectangular resolution (1024x2048, 2048x4096, etc.) from a UV sphere:

I’d like for these textures to be quickly usable for background planets for some scenes I am working on. So far, unwrapping these textures onto a UV sphere is fast and easy, although the texture does have small triangles that are either blank or filled using the pixel margin setting in the bake menu. This isn’t necessarily a problem when unwrapped onto a UV sphere with the same faces and shape, but I could see it being a problem if a target sphere doesn’t have the same number of triangles or if I wanted to use a different spherical primitive (?) instead. It also looks ugly at the poles, which would be a problem if I need a scene that includes one of them.

Is this workflow acceptable? I’ve successfully used these textures in Unreal 5, for example, but I’m not sure if the pinching at the poles is something I should strive to get rid of or just hide. Would it be better to bake and unwrap to a cube sphere? If so, how can I maintain the seamless quality?

Thanks for any help or pointers here.

I don’t have an answer, but I would a link to these when you sell them :slight_smile:

There is a reason why for example the NASA use equirectangular UV-mapping…
and also an easy fix for using those kind of textures on any sphere (even an icosphere)…

…so you might think about rendereing this not from a default unwrapped UV-sphere… but as equirectangular map and also tell users this “trick” ( in fact the correct way to use equirectangular textures )

Next question would be how to back this correctly… even if i never thought about this but doesn’t the bake feature use the selected coordinates ?? So using generated and sphere… :thinking:

…i will be off keyboard for a while… so i can’t check this rigth now.

I would just use a plane as the baking source, and transform its UV coordinates to Equi-Rectangular coordinates, and texture it and bake from there.
Here’s a nodegroup that does the transformation:

This maps the UV space to the 3D coordinates of a sphere, and if used with procedural textures it will show the 3D result at each UV points of the plane.

1 Like

Thank you, very useful. I would never have figured out the math nodes, so I’m grateful for the detailed reply. This has worked well for the textures I’ve tested so far, so I’m marking it as the solution to my question.

Sometimes I see planet or other sphere textures in 2:1 (or similar) rectangular ratios. Is there any benefit to baking textures in this ratio? Or are squares sufficient?

joseph said:

I don’t have an answer, but I would a link to these when you sell them :slight_smile:

Ha, while I would eventually like to sell something, I need to do more research on where I would do that (Blender Market? FAB? itch.io?) and how to price them. Until then, I plan to release at least some for free and, if I have the time, make a brief tutorial on how to create these.

1 Like

It just became a standard… or one of many… :wink:

Sorry if this is obtuse, but is your implication that the standard is arbitrary and no longer necessary to follow? I don’t want to spend a few dozen hours baking high resolution textures only to find out I chose an inefficient or incorrect plane size.

No… it’s just one in the general map the earth tasks using “some” projection and also often used in spherical projection in 3D … for example HDRI’s for scene lighting…

For equirectangular mappings, the 2:1 ratio is realy good for the texture output size. It maps well to 2*Pi:Pi coordinates over a sphere, and it’s easy to sample for a game engine or rt renderer.

In the Blender side, having it as a plane doesn’t matter that much. You can scale it to 2:1, as long as the UVs remain the same.
…for baking normal maps, this method get’s a bit trickier also :thinking:

1 Like