1
$\begingroup$

I have a complex model and I want to apply a Perlin noise texture on it. This model is to be used in a video game.

Because this can be generated, I was thinking of using a 3D texture to avoid having artifacts. From what I could find online this process seems to exist (UVW mapping, even though different people seem to use this name to refer to different things).

I am wondering if it is possible to create a 3D texture for Perlin noise, and then use Blender to generate a 2D texture + a corresponding UV map so that I can use these in my game engine.

$\endgroup$
2
  • $\begingroup$ UVW map is accurate name of UV map, it is result of unwrapping (unfolding) the mesh in order to get UV coordinates which will be used to map texture. Perlin noise texture is procedural one and it doesn't need UV map to be applied to mesh. However you need UV map if exporting that texture as it has to be baked and that's where UV coordinates will be required. Related blender.stackexchange.com/questions/90096/… $\endgroup$ – Mr Zak Oct 21 '18 at 10:09
  • $\begingroup$ Magic UV add-on has a tool to work with UVW $\endgroup$ – Serge L Oct 21 '18 at 10:14
2
$\begingroup$

What you are describing is exactly one of the uses of texture baking. In this case you could use either cycles or the old blender internal.

The process would be:

  1. Texture the object.
  2. UV unwrap the object.
  3. Bake the Perlin noise texture.

I'm using cycles, but the same principles apply to the BI (in the blender internal renderer you can pick what type of noise generator it uses, cycles only has perlin noise.)

Texturing

Texturing is very easy, because it is all procedural. My material is super basic, just the noise texture and a gamma node to boost the color:
cycles material nodes
Yes I'm using a teapot as my demo. Teapot


UV Unwrapping

In edit mode simply select everything and hit U > Smart UV Project. Depending on your model and what else you are going to do with it you might need a better UV map. Sufficient to say, smart uv project does not always do the best job. Yet if all you are going to do with it is bake a map, then this will do.
teapot's UV layout

Texture Baking

Before you can bake the texture you need to create an image blender will bake to. So in the UV Image Editor create a new image. "New" button in the header. Or if the new button is not showing, then click the "+" plus button in the image data block control, its still in the header.
Important Add an Image Texture node to the material for your object. Set the texture to the image you just created. The Image Texture node should not be connected to anything, but it must be active.
enter image description here All set for baking.
In the Properties window go to the Render tab and scroll down to the Baking section. Here change the bake type to Emit (notice I'm using an emission shader in my material), and hit the large Bake button.
texture bake settings

Presto you have a 3D procedural texture baked to a 2D image for further use anywhere.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.