I'll declare myself Mr.Tutorial!
For the ones that doesn't have too much time and need to understand what's going on, this tutorial explains how to do this:

(This tutorial isn't just for
Papervision3D, you can use it with any other 3D engine).
The point is that when you approach a realtime 3Dengine the best way to achieve good results is to think about how to use the resources you have.
Papervision3D still doesn't have illumination, but it can render polygons with textures. So, why don't we render the illumination to the texture with our 3D package? This is exactly what I thought when I did
this,
this and
this.
I'm afraid I've no idea of how to do this thing with any other package, but at least you will get the idea.
Ok, let's start...
Open 3D Studio MAX and all that, I believe the Render to Texture feature is there since the version 5 or 6... (I'm using 8).
Then we create a
Torus and a
Plane.

And we do an scene similar to this one:

The under the
Lights tab we select the
Skylight... er.. light, and with check the
Cast shadows checkbox. The rays per sample parameter is the quality, if your machine is slow, put it to 5 or 10 just for testing, I usually do the tests with 5, and then when I go to do the render to texture I put it up to 30.

I'm don't thing the position of the light really matters, this is not one of those lights that you need to focus on something, just put it anywhere.

Half of the work done! If we do a Render right now, It should look like this:

Now, sometimes the 3D object we want to render the texture from is quite complex, so we need to
Unwrap the mesh to a plane so we make things easier to the render to texture thing. (You'll understand what I mean in a sec). So, under the
Modifiers tab, we select the
Unwrap UVW from the
Modifier List. And then we click on
Edit.
A new window will appear with the mesh on a plane in wireframe. First we click on the
3rd option of the
Selection Modes, and then We go to
Mapping/Flatten Mapping.

On the new window that will appear we put the
Spacing to 0.0 and we click OK, this will explode your mesh to the best (not always) way so the Render to Texture can put as much information as possible into the texture.

The end result should look something similar to this:

We close the window, and then with the Torus object stil selected we go to
Rendering/Render To Texture.

On the new window, we scroll down to the
Output part and we click on
Add... to add a new texture you want to bake. This will prompt another window where we have to select
CompleteMap.

If we scroll down that panel a bit, we will see the options for the final texture. If you want to save the texture in a different path, well... feel free. I usually do the renders to
1024, and in case isn't it can be reduced then I reduce them to 512 with Photoshop.
As the last thing, If you don't want MAX to change the texture of the Torus with the backed one, I recommend you to check the
Render To Files only checkbox.

We click on
Render and after we'll end up with a texture similar to this:

And that's all, I'm afraid I won't go into the part of doing the code with
Papervision3D for loading all this, but I'm sure you know how to use this texture now ;)
Hope this is useful for someone
8 comments