OgreMax Exporter 1.5 - With Material Editor/Viewer

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218
Contact:

Re: OgreMax Exporter 1.5 - With Material Editor/Viewer

Post by Jabberwocky »

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?

Thanks!
Image
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218
Contact:

Post by Jabberwocky »

Sounds great, thanks for the detailed response.
Image
User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

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. :)

Nulle rule sine exceptione (lat.)
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

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.
User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

You use mental ray for normal maps? Isn't that what Kaldera is for?
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was. :)

Nulle rule sine exceptione (lat.)
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

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.
User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

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. :)

Nulle rule sine exceptione (lat.)
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Post by xabila »

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 ;)
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

I don't understand what you mean by
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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Post by xabila »

Sorry if it wasn't clear

the *-> was the directory structure :oops:
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

Code: Select all

export . ( so the folder where i will get toto.scene)
    |--mesh
    |--textures
  
And i get

Code: Select all

 
 .
|--mesh
|--mesh | -- mesh
|--mesh | -- textures
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
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

Ah, now I understand. I'll take a look at this issue. Thanks for reporting it.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

Problem fixed. The newest OgreMax release also contains a number of other fixes, tweaks, internal changes, and additions.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Post by xabila »

Thanks a lot !
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Post by xabila »

There is some empty userdata element now, even if i don't add userdata on mesh :

Code: Select all

<userData>
<![CDATA[]]>
</userData>
But the export is ok;)
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Post by xabila »

And make bigger files :lol:, but it's ok for me
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

Yeah, that too.

I just made a small update that addresses this.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
User avatar
Marioko
Halfling
Posts: 43
Joined: Sun Aug 13, 2006 5:38 pm
Location: Cartagena - Colombia

Post by Marioko »

hi..

where can i find the DTD of the .scene XML files???

I need it for a custom sceneparser for mogre..

thanks..
Mars
Halfling
Posts: 42
Joined: Thu Mar 29, 2007 1:31 am

Post by Mars »

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. :wink:
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

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. :wink:
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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
Mars
Halfling
Posts: 42
Joined: Thu Mar 29, 2007 1:31 am

Post by Mars »

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).
User avatar
nedelman
Gnome
Posts: 315
Joined: Wed Feb 21, 2007 6:03 am
Location: San Francisco, California
x 6
Contact:

Post by nedelman »

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.
http://www.ogremax.com - Ogre3D Scene Exporter for 3DS Max, Maya, and Softimage
http://www.linkedin.com/in/dereknedelman - My LinkedIn Profile
Mars
Halfling
Posts: 42
Joined: Thu Mar 29, 2007 1:31 am

Post by Mars »

I updated the project to 1.5.13 today
That's really a fast move for catching up :wink:
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)

Code: Select all

Ogre::Root::getSingleton().detachRenderTarget(renderTarget);
delete renderTarget;
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.
Post Reply