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
Contact:

Re: OgreMax Exporter 1.5 - With Material Editor/Viewer

Post by Jabberwocky » Thu Nov 01, 2007 3:20 am

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!
0 x
Image

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

Post by nedelman » Thu Nov 01, 2007 9:34 am

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.
0 x
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
Contact:

Post by Jabberwocky » Thu Nov 01, 2007 2:26 pm

Sounds great, thanks for the detailed response.
0 x
Image

User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix » Thu Nov 01, 2007 3:23 pm

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.
0 x
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
Contact:

Post by nedelman » Thu Nov 01, 2007 4:14 pm

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.
0 x
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
Contact:

Post by Evak » Thu Nov 01, 2007 4:25 pm

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.
0 x

User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix » Thu Nov 01, 2007 4:49 pm

You use mental ray for normal maps? Isn't that what Kaldera is for?
0 x
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
Contact:

Post by Evak » Thu Nov 01, 2007 5:43 pm

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.
0 x

User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix » Thu Nov 01, 2007 5:48 pm

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!
0 x
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 » Wed Nov 07, 2007 12:30 pm

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 ;)
0 x

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

Post by nedelman » Wed Nov 07, 2007 6:21 pm

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.
0 x
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 » Wed Nov 07, 2007 8:03 pm

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
0 x

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

Post by nedelman » Wed Nov 07, 2007 9:16 pm

Ah, now I understand. I'll take a look at this issue. Thanks for reporting it.
0 x
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
Contact:

Post by nedelman » Thu Nov 08, 2007 2:38 am

Problem fixed. The newest OgreMax release also contains a number of other fixes, tweaks, internal changes, and additions.
0 x
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 » Thu Nov 08, 2007 8:25 am

Thanks a lot !
0 x

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

Post by xabila » Thu Nov 08, 2007 9:41 am

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;)
0 x

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

Post by nedelman » Thu Nov 08, 2007 12:50 pm

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.
0 x
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 » Thu Nov 08, 2007 12:53 pm

And make bigger files :lol:, but it's ok for me
0 x

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

Post by nedelman » Thu Nov 08, 2007 2:23 pm

Yeah, that too.

I just made a small update that addresses this.
0 x
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 » Fri Nov 16, 2007 4:36 am

hi..

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

I need it for a custom sceneparser for mogre..

thanks..
0 x

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

Post by Mars » Sat Nov 17, 2007 10:49 am

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:
0 x

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

Post by nedelman » Fri Nov 23, 2007 12:10 am

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.
0 x
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 » Fri Nov 23, 2007 1:05 am

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).
0 x

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

Post by nedelman » Fri Nov 23, 2007 7:59 am

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.
0 x
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 » Fri Nov 23, 2007 3:15 pm

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.
0 x

Post Reply