Gile[s] Lightmapper Ogre export plugin

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

hebdemnobad wrote:walaber i have been getting errors when trying to view a gile[s] exported scene using the directx renderer, but not the opengl renderer. opengl works fine (but has other limitations)...is this a limitation of the exporter? if not, i'll try to isolate the problem.thanks!
I have the same problem. If I run the application using the OpenGL renderer, it works... but with the D3D renderer it closes itself automatically.
Here is the error in the Ogre.log file when running with D3D renderer:

-----------------------------------
Details:
-----------------------------------
Error #: -2005530516
Function: D3D9RenderSystem::_render
Description: Failed to DrawPrimitive : Invalid call.
File: c:\softwaredevelopment\c++\ogresdk\ogrenew\rendersystems\direct3d9\src\ogred3d9rendersystem.cpp
Line: 2179
Stack unwinding: D3D9RenderSystem::_render(..) <- <<beginning of stack>>

What can it be? I need to use the D3D renderer...
Thanks in advance :wink:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Debug, debug, debug - the only way to know. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

I'm using Code::Blocks with Visual C++ Toolkit... there's no a debugger...
User avatar
BlasterN
Gnome
Posts: 378
Joined: Thu Mar 24, 2005 1:07 am
Location: Spain

Post by BlasterN »

I think the problem is in the mesh.

BTW: there is a way to test if the mesh is good formated or something like that.
Works:
MapToMesh | Bengine B9 @ www.sourceforge.net/projects/maptoogremesh/
3DWorldStudio exporter@ www.blastern.info
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

BlasterN wrote:[...]BTW: there is a way to test if the mesh is good formated or something like that.
What's the way to test the mesh? :D
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

A friend of mine have been trying the map in the scene with Direct3D renderer... It works on his system... How this is possible? :?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Some drivers are more tolerant than others. Some will choke on things that others let through, like zero-sized arrays.
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

sinbad: Thanks! Now I know that I will release my game with only one renderer (unfortunately I don't have much time for testing :? )

But... So what do you think? The problem is in the mesh? I don't know how to resolve it... :(
Eclipse
Gnoblar
Posts: 8
Joined: Thu May 06, 2004 5:37 pm

Post by Eclipse »

i have the same problem... this giles exporter is unusefull :?
go superwalaber, we're calling u, fix that problem :D
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

DX9 debugging

Post by Lee04 »

If you don't have debugger well at least you can use NVidias PerformanceHUD (i don't know if it works on non nvidia cards)
you get a debug spew there and you have aadvanced renderstate view.

Also you can set DirectX9 to debug mode and turn up warning level and
check Ogres log files.


Well hope this helps.


/Lee04
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

I solved the problem... I was using the DirectX debug mode.. Now with the retail mode it works. However thanks!!!
User avatar
zmora
Gnoblar
Posts: 8
Joined: Sat May 14, 2005 2:21 pm
Location: Poland

Post by zmora »

I've downloaded Falagard's mod of walaber's exporter and found few small issues (well, maybe even small bugs):
1. scale is not handled properly. If I scale scene in max, then export it to 3ds and import this 3ds in gile[s], and then export into ogre, scene is not scaled, everything seems to be like in original max file, that is before aplying scaling. So I added PLUGIN_MODEL_GLOBAL_SCALE to LoadSingleModelData and store his scale in model's info. Then in LoadMeshData, just before CheckBoundingBox(...), I scale vertex by this value, so that model is properly sized.
2. so we get to the CheckBoundingBox. Well, it seems, that it should work ok, however it looks like variables mesh_max and mesh_min in model's info are _not_ initialized, resulting in enormous bounding radius. I changed this function a bit, and now it looks like this:

Code: Select all

void CheckBoundingBox( Ogre::Vector3& vec )
{
models[modelIndex].bound.merge( vec );
models[modelIndex].max_radius = (models[modelIndex].bound.getMaximum() - models[modelIndex].bound.getMinimum()).length()/2.0f;
}
and of course ExportOgreMeshes:

Code: Select all

exportMesh->_setBounds( models[modelIndex].bound );
exportMesh->_setBoundingSphereRadius( models[modelIndex].max_radius );
3. also, because we do like quaternions in our .scene format, then it may be better idea to handle PLUGIN_MODEL_GLOBAL_QUATERNION than PLUGIN_MODEL_GLOBAL_ROTATION.

Those are my little tips, maybe someone will find them usefull. Anyway, thanks guys for doing this exporter, I wouldn't even where to start ;-)
cheers
User avatar
SunSailor
Gnoll
Posts: 699
Joined: Sun Jan 02, 2005 5:45 pm
Location: Velbert, Germany
x 2

Post by SunSailor »

Because gile[s] is (even very low cost) commercial, I would like to ask what the status for the exporter is. Is it usable at the moment to use a prelighted scene in Ogre without big efforts or where is still work needed to be done?
Hangman
Gnoblar
Posts: 17
Joined: Tue Jun 14, 2005 4:32 pm
Location: Salerno (Italy)

Post by Hangman »

No it works well ;)
User avatar
SunSailor
Gnoll
Posts: 699
Joined: Sun Jan 02, 2005 5:45 pm
Location: Velbert, Germany
x 2

Post by SunSailor »

Sadly, I can't access the CVS for the addons at the moment, but is it true, that the exporter only supports exporting the geometry as one mesh? Isn't there a 64K border? We'll have some very complex scenes, isn't this a drawback there or is this really the better solution?
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA

Post by walaber »

yes, that's true. my exporter will probably not handle very large scenes that way. in this thread (back toward the beginning), a modified version that exports to the .scene format was posted, you may want to look into that.

otherwise, you will need to make your Gile[s] scene up of several objects, and when the scene is complete, delete all but 1 object and export 1 at a time. :wink:
Go Go Gadget OGRE!!
Image
ggunhouse
Kobold
Posts: 28
Joined: Tue May 17, 2005 2:10 pm
Location: Atlanta, Georgia

Post by ggunhouse »

Hi, Walaber,
I've been using your exporter to produce lightmaps for environments made for the Blink 3D viewer. It used to work great. Now Blink 3D has been updated to use Dagon 1.2.0 (from Azathoth 1.0.6) and the material files produced by your exporter no longer make it through the material parser. Instead I get errors like these:

Code: Select all

23:31:10: Parsing script nakht.material
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 3 of nakht.material: Expecting '{' but got scene_blend alpha_blend instead.
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 4 of nakht.material: Unrecognised command: texture_unit
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 5 of nakht.material: Unrecognised command: {
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 6 of nakht.material: Unrecognised command: texture
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 7 of nakht.material: Unrecognised command: filtering
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 8 of nakht.material: Unrecognised command: tex_coord_set
23:31:10: Error in material Gile[s]_MatTex_1_1lar 0 0 0 0 at line 9 of nakht.material: Unrecognised command: colour_op_ex
23:31:10: Error at line 11 of nakht.material: Unexpected terminating brace.
23:31:10: Error at line 12 of nakht.material: Unexpected terminating brace.
23:31:10: Error at line 13 of nakht.material: Unexpected terminating brace.
23:31:10: Error in material Gile[s]_MatTex_1_2lar 0 0 0 0 at line 17 of nakht.material: Expecting '{' but got scene_blend alpha_blend instead.
23:31:10: Error in material Gile[s]_MatTex_1_2lar 0 0 0 0 at line 18 of nakht.material: Unrecognised command: texture_unit
23:31:10: Error in material Gile[s]_MatTex_1_2lar 0 0 0 0 at line 19 of nakht.material: Unrecognised command: {
These errors are caused by extraneous characters in the material file (they appear to me as little squares at the ends of certain lines). Azathoth seems to have ignored these characters. Dagon doesn't and produces errors. As a result, the material fails and the environment appears with no textures. Can you look into this and see if you can correct the problem?
Thanks.
Glenn
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA

Post by walaber »

i believe I fixed it... and updated CVS... but I should check again. I'll repost once I have checked. the download on my website *should* be up to date though
Go Go Gadget OGRE!!
Image
ggunhouse
Kobold
Posts: 28
Joined: Tue May 17, 2005 2:10 pm
Location: Atlanta, Georgia

Post by ggunhouse »

I downloaded the version currently on your website, but the exported material files still have the extra characters (line-feeds?) after every material name and texture name.

Image
Glenn
Zakk777
Gnoblar
Posts: 1
Joined: Wed Jul 26, 2006 8:18 pm

Post by Zakk777 »

Hi!
How can I get exported mesh to receive shadows?

I replaced ground plane with my exported mesh in basic tutorial 2, but I can't get it to receive any kind of shadows. I have tried differend things I have found from this forum and wiki. I'm just learning to use Ogre, so there must be something I've missed.

I have also those squares in the material file, but after I removed them the mesh works (except shadows).

What's the lower button in the Gile[s] OGRE Exporter Options -dialog? I have only question marks in it.
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Re: Gile[s] Lightmapper Ogre export plugin

Post by hebdemnobad »

I'm trying to find the gile{s} exporter, but Walaber no longer has it up on his site. Walaber oranyone else have it? Thanks!
-h
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Gile[s] Lightmapper Ogre export plugin

Post by jacmoe »

It was put up on the Sourceforge ogreaddons repository also, AFAIK.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Re: Gile[s] Lightmapper Ogre export plugin

Post by hebdemnobad »

thx, I actually found it on one of my hard drives and posted the .rar archive to the wiki.
-h
User avatar
Zonder
Ogre Magi
Posts: 1173
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: Gile[s] Lightmapper Ogre export plugin

Post by Zonder »

There is already a page for this not sure were you added the rar, fixed the link back to this thread while I was on it :)

http://www.ogre3d.org/tikiwiki/tiki-ind ... ef_id=1463
There are 10 types of people in the world: Those who understand binary, and those who don't...
User avatar
hebdemnobad
Goblin
Posts: 274
Joined: Wed Feb 09, 2005 5:09 pm
Location: catskill escarpment, new york, usa
x 3

Re: Gile[s] Lightmapper Ogre export plugin

Post by hebdemnobad »

Zonder wrote:There is already a page for this not sure were you added the rar, fixed the link back to this thread while I was on it :)

http://www.ogre3d.org/tikiwiki/tiki-ind ... ef_id=1463

The .rar archive is the file attachment on the wiki page.