[Solved] help me get a Gile[s] lightmap into my game?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
byte_wrench
Gnoblar
Posts: 17
Joined: Sun Jun 10, 2007 3:25 am
Location: Lebanon, TN USA
Contact:

[Solved] help me get a Gile[s] lightmap into my game?

Post by byte_wrench »

I am using walaber's exporter, but I am having no luck at all. Here is what I have done: Peice my scene together in Gile[s], place my lights, remove all but the floor (just a plane), put the resulting .material(cleaned up the invalid characters), lightmap texture, and .mesh file where my game can find it. When I run my game I get "Cannot create D3D9 Index buffer" when loading the .mesh.

Are there any step by step tutorials on getting a lightmap into Ogre? I would really be grateful if someone would help me with this.

Thank you!
Last edited by byte_wrench on Mon Aug 06, 2007 9:37 pm, edited 1 time in total.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Post by Praetor »

To Ogre a lightmap is nothing more than a regular texture. It isn't treated special, so it seems like your problem is either with the exporter (bug, or out of date maybe) or with something you might be doing. Does the exporter create the .mesh, or is it created in some other tool and simply used by Giles and your app? Can you post your initialization code?
byte_wrench
Gnoblar
Posts: 17
Joined: Sun Jun 10, 2007 3:25 am
Location: Lebanon, TN USA
Contact:

Post by byte_wrench »

Yes, it does produce a .mesh file. I am simply doing:

Code: Select all

Entity * Floor = SceneMgr->createEntity("floor", "floor.mesh");
When this code gets hit, everything stops with

Code: Select all

11:24:19: OGRE EXCEPTION(3:RenderingAPIException): Cannot create D3D9 Index buffer: Invalid call in D3D9HardwareIndexBuffer::D3D9HardwareIndexBuffer at ..\src\OgreD3D9HardwareIndexBuffer.cpp (line 65)
I have tried running the mesh through the meshUpgrader, and the XMLConverter to no avail, yet when I convert it to XML I do get a different error, something about header info and Endian?

Is there a more simple way to produce a nice light map for my Ogre game?
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
x 3
Contact:

Post by Falagard »

I'm guessing the giles exporter uses an old version of Ogre so the mesh format is unsupported, or it is doing something wrong. You could look at Walaber's source code and try to fix it.
byte_wrench
Gnoblar
Posts: 17
Joined: Sun Jun 10, 2007 3:25 am
Location: Lebanon, TN USA
Contact:

Post by byte_wrench »

Thanks Falagard, I will start on that now and post any findings

[edit]
Whew! with encouragement from Falagard and 10 minutes, it worked!
And just to think, I spent 2 days on this! Now to create some nice lights.

Just recompiled with current version of Ogre, and put the new OgreMain.dll in the Gile[s] folder, and the newly compiled ExportOgre.dll into the Exporters folder, and off I go...

Thank You!!
[/edit]
byte_wrench
Gnoblar
Posts: 17
Joined: Sun Jun 10, 2007 3:25 am
Location: Lebanon, TN USA
Contact:

Post by byte_wrench »

one more note: when exporting your lightmap from Gile[s] be sure to remove any unused textures, and use the mesh converter to convert the mesh to xml. Then scroll through the xml toward the bottom, and look for any empty submeshes. Remove them if present. You might get a vertex buffer error from Ogre if you don't. Then you can convert the mesh back to binary, and you should be good to go.
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

hmmm... that sounds like an error in my exporter, no?

once the new version of Gile[s] is released, I would like to update my exporter, and perhaps make it a bit more flexible.
Go Go Gadget OGRE!!
Image
Post Reply