nedelman wrote:
Lightmapping with the 3DS Max "render to texture" feature
Hi Nedelman,
I'm interested in learning more about this feature.
Does OgreMax export lightmaps for scene objects?
If so, could you briefly describe the process, or point me towards any documentation on this?
OgreMax has a few features that allow for interaction with the 3DS Max 'render to texture' feature.
I'd first recommend that you go through the 'render to texture' tutorial that comes with 3DS Max. It gives you a basic walkthrough of using the feature to generate a light map for an airplane. There are a few key points to take away from this tutorial (even if some of these points aren't explicitly stated):
1)Light maps are generated per object
2)Each object must have its own material in order for the results to be correct.
3)The typical use of the 'render to texture' feature is to have it create a "Shell" material that contains a copy of the original material and a new material based on the original material.
Once you understand these things, making the jump to using OgreMax with the 3DS Max 'render to texture' feature is pretty easy. Keep these things in mind:
1)All the objects that you are generating light maps for must have an OgreMax Material (or a multimaterial with OgreMax submaterials) applied to them. You can't have a mix of OgreMax and built-in 3DS Max materials.
2)There is no need to create Shell materials when using OgreMax materials. This is because the OgreMax material is a sort of shell material already.
3)If you have multiple objects using the same material, you can create unique materials for those objects by selecting the objects and running the OgreMax->Create Master/Slave Materials utility. This will create and apply "slave" materials which are linked to the original "master" material so that if you later decide to make some changes to the master you can propogate those changes to the slaves.
That's a pretty broad overview. For more detail you can take a look at a tutorial included with the OgreMax Scene Exporter documentation that walks you through the creation of a scene that uses light maps.
Hey, Nedelman, that feature is really great, but I was just wondering - is it just me, or it is really not possible to use mental ray with lightmapping? I mean not just pure mental ray, but with all the finalGather, etc.
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was.
I haven't used mental ray for this purpose but you should be able to configure any renderer that is installed with Max. Try clicking the "Setup..." button in the 'render to texture' window.
Mental ray does easy normal map and has a fast ambient occlusion shader for baking AO in seconds rather than minutes to your UV's. Havent tried lightmaps though.
you can use the scanline renderer and mental ray for normal maps. It's pretty easy to use the normal map tools in max now. just have 2 meshes, check projection, click add and add your high detail mesh, reset the projection distance, you can edit the projection cage at the subobject level too. add normal map, and click render.
So long as you have UV's on your low poly mesh it just works. you can paint bump maps on your high res mesh and those are included in your normal maps too. You don't really need 3rd party plugins for 3dsmax anymore, most of them are a waste of money.
Awesome, thanks!
It just so happened, that I was using Kaldera back from Max7. Even now, with the latest version still didn't bother reading about the new features.
So, thanks again!
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was.
Thanks for your exporter, it works very well.
but i've got one Bug, on the export directory.
I want to have this :
toto.scene
toto.material
*->mesh
*->textures
And i get :
toto.scene
*->mesh
*->mesh*->toto.material
*->mesh*->mesh
*->mesh*->textures
prefix for mesh and material will be also a nice feature
xabila wrote:
I want to have this :
toto.scene
toto.material
*->mesh
*->textures
And i get :
toto.scene
*->mesh
*->mesh*->toto.material
*->mesh*->mesh
*->mesh*->textures
prefix for mesh and material will be also a nice feature
What is *->mesh*->mesh?
Also, what do you mean by a "prefix for a mesh and material"?
Take a look at the Directories tab on the Scene Settings page. You can set an export directory for your meshes, materials, and bitmaps. To have the exporter copy your scenes bitmaps to the export directory, look at the "Copy Bitmaps to Export Directory" setting on the Bitmaps page.
the *-> was the directory structure
So yes i have seen on the Scene settings page that i can set export directory, and it's the point, i have a bug with this export.
i Set the export tab to get
So i get a free mesh folder maybe you have set the export folder by default to mesh ?
And i meant by prefix, if there is a way to add a prefix on all the material name, but it's more a usefull max script than an exporter option.
Thanks anyway
I was so focused on making sure the new changes worked that I didn't notice the empty user data items. I'll have that fixed for the next release. It's a pretty minor thing though, and doesn't have any negative effect aside from being a little ugly.
Hi, nedelman:
A little bug about OgreMaxViewer.exe spotted...
If I run one of the examples provided, and then open OgreMaxViewer.exe, the last image will persist. Not sure why, supposing un-released resources. So this may not be good.
Mars wrote:Hi, nedelman:
A little bug about OgreMaxViewer.exe spotted...
If I run one of the examples provided, and then open OgreMaxViewer.exe, the last image will persist. Not sure why, supposing un-released resources. So this may not be good.
Sorry for the delayed response, but I've been extremely busy with work (including OgreMax) for the last week. If a day ever passes before I answer a post, it would be best to send me a private message.
The behavior you're observing is not a bug. When you run the viewer without an initial scene file, no drawing will occur, so you'll see whatever happens to be in the video memory that the video driver is using. So, if you've just closed a previous instance of the viewer, then you'll most likely see whatever you were looking at the last time you ran the viewer.
Hi,
Thanks for your explaination.
These days I was thinking about that too, and maybe a call of renderSys->clearFrameBuffer(Ogre::FBT_COLOUR | Ogre::FBT_DEPTH | Ogre::FBT_STENCIL ); will do the work. Hope that help.
BTW, when I try TextureShadows demo, there is some error after it shut down(edition1.5.9).
Mars wrote:Hi,
Thanks for your explaination.
...when I try TextureShadows demo, there is some error after it shut down(edition1.5.9).
I'll keep an eye on that issue. I haven't noticed any stability problems with the shadow demo, but I've noticed the visual appearance is a little inconsistent at times. As always, I'd recommend that you use the latest OgreMax (I updated the project to 1.5.13 today), though I haven't done anything with the shadows demo since the 1.5.0 release.
That's really a fast move for catching up
I have read about souce for some while, and found that render targets created during parsing scene file are not released when destructor of OgreMaxScene was called. When I ran DynamicEnvironmentMap demo the same problem occured once, so I stepped into OgreMaxScene::LoadRenderTextures, there is a cube texture created and not released when I shut down ogre(the error line is at delete ogre root). So I added the following line to the source(not sure whether you mind it)
to OgreMaxScene::Destroy(). The problem solved. But later when I ran TextureShadows demo, the error occured again. I think it must be some other render target not released first, and the line at delete ogre root clearly shows there is one rtt/... in the render target list of root's member. So I wonder if you forget to do the whole cleaning work at destructor.