Gile[s] Lightmapper Ogre export plugin
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
alright, I'll make my own simple model viewer to test the models...
I really should implement a preview right into the exporter, but that would probably require a lot of recoding
currently I'm generating the material scripts by hand (writing to a text file)... would it be smarter to build the materials in code, and use the serializer to save them out to a file?
I really should implement a preview right into the exporter, but that would probably require a lot of recoding

currently I'm generating the material scripts by hand (writing to a text file)... would it be smarter to build the materials in code, and use the serializer to save them out to a file?
-
- OGRE Retired Team Member
- Posts: 3067
- Joined: Tue Feb 10, 2004 12:53 pm
- Location: The Netherlands
- x 1
Probably true... given that you can assume some intelligence from the underlying rendering API and drivers to ignore the lighting calculations with diffuse, specular and ambient equal to 0.sinbad wrote:Emissive / ambient only lighting is cheap in the extreme, I doubt setting a base material colour is measurably faster.
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
hmm... I implemented the MaterialSerializer... but it doesn't seem to be working right... here's my Ogre Log file:
but here is the Giles.material file it creates:
...that's the entire file
I think I'm creating the materials properly... and the log shows that it's adding 3 materials to the queue...
I'll keep fiddling with it!
Code: Select all
12:24:14: MeshSerializer writing mesh data to C:\Documents and Settings\Timmy\My Documents\Visual Studio Projects\GilesExport\TEST SCENES\boxes.mesh ...
12:24:14: File header written.
12:24:14: Writing mesh data...
...[mesh expor log removed]
12:24:14: Mesh data exported.
12:24:14: MeshSerializer export successful.
12:24:14: MaterialSerializer : writing material Gile[s]_RED to queue.
12:24:14: MaterialSerializer : done.
12:24:14: MaterialSerializer : writing material Gile[s]_BLUE to queue.
12:24:14: MaterialSerializer : done.
12:24:14: MaterialSerializer : writing material Gile[s]_LIMEFLY to queue.
12:24:14: MaterialSerializer : done.
12:24:14: MaterialSerializer : writing material(s) to material script : Giles.material
12:24:14: MaterialSerializer : done.
Code: Select all
material Gile[s]_RED

I think I'm creating the materials properly... and the log shows that it's adding 3 materials to the queue...
I'll keep fiddling with it!
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
still can't get the MaterialSerializer to work right... so I'm back to my by-hand method...
the exporter is making excellent progress... there are still a few issues with replicating Gile[s] exactly, but I think the exporter is very usable now.
with a little hand-editing the material scripts, you can usually get anything looking great...
yet another WIP screenshot:

the exporter is making excellent progress... there are still a few issues with replicating Gile[s] exactly, but I think the exporter is very usable now.
with a little hand-editing the material scripts, you can usually get anything looking great...
yet another WIP screenshot:

-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
yet another question
say I have an image and I would like to set a "mask" to it.
basically, I want all pixels of a certain color to be completely transparent, and all other pixels to be completely opaque.
I assume I'd use "colour_op_ex blend_manual" in the material script, but I can't seem to figure out how to set it up...
any advice/help would be greatly appreciated!

say I have an image and I would like to set a "mask" to it.
basically, I want all pixels of a certain color to be completely transparent, and all other pixels to be completely opaque.
I assume I'd use "colour_op_ex blend_manual" in the material script, but I can't seem to figure out how to set it up...
any advice/help would be greatly appreciated!

-
- OGRE Retired Moderator
- Posts: 1365
- Joined: Tue Sep 07, 2004 12:43 pm
- Location: Aalborg, Denmark
You have to create an alpha channel and use alpha rejection. See this thread.walaber wrote:say I have an image and I would like to set a "mask" to it.
basically, I want all pixels of a certain color to be completely transparent, and all other pixels to be completely opaque.
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- Google Summer of Code Mentor
- Posts: 295
- Joined: Fri Aug 06, 2004 10:25 pm
when you turn the lighting off, there is no effect of the material color settings on the mesh, as the ambient/diffuse ..... colors are counted when the light is calculated per vertex, so no light calculation, no use of the material colors
when the entity is not using realtime light, it uses precalculated light, and that is the vertex colors, so if you want the entity to be colored, export the diffuse component of the vertex with the colors needed, light/shadow color can be precalculated, thus saving some render times, but its resolution is dependant on the mesh tesselation
when using the vertex colors to render, you can use the alpha component to make the entities transparent with the per vertex apha value
Lioric
when the entity is not using realtime light, it uses precalculated light, and that is the vertex colors, so if you want the entity to be colored, export the diffuse component of the vertex with the colors needed, light/shadow color can be precalculated, thus saving some render times, but its resolution is dependant on the mesh tesselation
when using the vertex colors to render, you can use the alpha component to make the entities transparent with the per vertex apha value
Lioric
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- Kobold
- Posts: 35
- Joined: Fri Jan 14, 2005 1:21 am
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
UPDATE
sorry for the delay everyone, was too busy with Stunt Playground
I've updated the Gile[s] exporter! it's now been compiled in release mode, and updated to Ogre 1.0. I also made a slight change to the material script producer.
anyway, it has been tested with the newest version of Gile[s] (1.35a) on 2 machines, and seems to work fine. please follow the install instructions carefully because some files are no longer needed, and others have had name changes.
also I have no internet at home now, so unfortunately I can't update the CVS version properly... so this is a binary release only. sinbad, if you can update it for me, I'd be glad to send you the updated source code!
BINARY DOWNLOAD - .rar archive, approx 1MB
sorry for the delay everyone, was too busy with Stunt Playground

I've updated the Gile[s] exporter! it's now been compiled in release mode, and updated to Ogre 1.0. I also made a slight change to the material script producer.
anyway, it has been tested with the newest version of Gile[s] (1.35a) on 2 machines, and seems to work fine. please follow the install instructions carefully because some files are no longer needed, and others have had name changes.
also I have no internet at home now, so unfortunately I can't update the CVS version properly... so this is a binary release only. sinbad, if you can update it for me, I'd be glad to send you the updated source code!
BINARY DOWNLOAD - .rar archive, approx 1MB
-
- Gnoblar
- Posts: 17
- Joined: Wed Mar 16, 2005 4:33 pm
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- Gnoblar
- Posts: 17
- Joined: Wed Mar 16, 2005 4:33 pm
-
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
I don't think he is able to:sinbad wrote:@walaber: can you update CVS with this new version please?
walaber wrote:also I have no internet at home now, so unfortunately I can't update the CVS version properly... so this is a binary release only. sinbad, if you can update it for me, I'd be glad to send you the updated source code!

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Goblin
- Posts: 274
- Joined: Wed Feb 09, 2005 5:09 pm
- Location: catskill escarpment, new york, usa
- x 3
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Doh, that's skim reading for you - I'm in a rush too much these days.jacmoe wrote:I don't think he is able to:sinbad wrote:@walaber: can you update CVS with this new version please?walaber wrote:also I have no internet at home now, so unfortunately I can't update the CVS version properly... so this is a binary release only. sinbad, if you can update it for me, I'd be glad to send you the updated source code!
@walaber: yes please do send me the code updates and I'll commit them for you.
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
sinbad - will do. however I'm in the middle of adding a few features that will truly make the exporter useful... so give me a few days, and I'll provide you the source for the new release!
the new version will have the option to copy over all textures for the model with the export, and also have an option to automatically "fix" textures with the "MASK" mode in Gile[s]. by adding an alpha channel to the texture, making it transparent wherever there is a fully black pixel. this should make most models export directly from Gile[s] into usable OGRE meshes
in the process I'm also learning how to use the devIL library directly
the new version will have the option to copy over all textures for the model with the export, and also have an option to automatically "fix" textures with the "MASK" mode in Gile[s]. by adding an alpha channel to the texture, making it transparent wherever there is a fully black pixel. this should make most models export directly from Gile[s] into usable OGRE meshes

in the process I'm also learning how to use the devIL library directly
