View previous topic :: View next topic |
Author |
Message |
Animeblood Member
Joined: 25 Feb 2005 Posts: 12
|
Posted: Mon Jul 25, 2005 6:18 pm Post subject: Exporting Light Maps in .X Files |
|
|
Hiya People! This here is the one and only Animeblood!
I was wondering how come whenI export .X files that are lightmapped in LITE version as I'm using them for DB and I use NGC for collision which doesnt like DBOS so I cant use those. Can anyone help me out as to why I dont get lightmaps exported as well? |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Mon Jul 25, 2005 6:23 pm Post subject: |
|
|
Hi there Anime! Lightmapping requires multiple UV-coordinates per vertex (e.g one pair for the normal texturemap and one pair for the lightmap) but .X files don't support that. |
|
Back to top |
|
|
Animeblood Member
Joined: 25 Feb 2005 Posts: 12
|
Posted: Mon Jul 25, 2005 6:25 pm Post subject: |
|
|
Argh. Then how come Cshop files can be exported with .x and still have lightmaps. ? |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Mon Jul 25, 2005 7:08 pm Post subject: |
|
|
Dunno, maybe he's using a different form of .x? |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Mon Jul 25, 2005 7:34 pm Post subject: |
|
|
No. Carthography shop exports two .x files: one for the normal materials, and one for the lightmap. Which is a very nice trick, but only Darkbasic Pro can read and combine those files (as far as I know: correct me if I'm wrong here). As we already have a plugin for straight export to DBO file format (including lightmaps), we didn't bother to implement such a 'export dual .x file' system. |
|
Back to top |
|
|
ayufan Member
Joined: 17 Jan 2005 Posts: 8
|
Posted: Fri Aug 19, 2005 9:50 am Post subject: |
|
|
No guys, you are wrong. X files can have more than one texture coordinate set. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Aug 19, 2005 10:31 am Post subject: |
|
|
That sounds great! Do you have more info (url) for us to look at? |
|
Back to top |
|
|
ayufan Member
Joined: 17 Jan 2005 Posts: 8
|
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Fri Aug 19, 2005 11:36 am Post subject: |
|
|
Direct3d isn't an option, for we use OpenGL (and plan to keep it that way). We'll take a closer look to the link you've provided. Thanks! |
|
Back to top |
|
|
ayufan Member
Joined: 17 Jan 2005 Posts: 8
|
Posted: Fri Aug 19, 2005 1:11 pm Post subject: |
|
|
Yes I know, but for exporting you can create temporary direct3d device. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Aug 19, 2005 7:42 pm Post subject: |
|
|
Ayufan, please be more specific. Where in those specs do you find evidence that .X files support multiple sets of texture coordinates? A Mesh has just one set of MeshTextureCoordinates, which is just one array of 2 coordinates, so how would one go about defining multiple sets?
Besides that, the point really isn't wether .X supports it (as .X is an extendible format, you can basically put in there whatever you want as long as you define your templates right), but wether there is a common standard that other programs will load. I don't know of any 3D renderer that supports multitextured .X files.
But please, prove us wrong if we are! |
|
Back to top |
|
|
ayufan Member
Joined: 17 Jan 2005 Posts: 8
|
Posted: Fri Aug 19, 2005 8:41 pm Post subject: |
|
|
I have discovered it using 3dsmax when I was generating lightmaps (baking). To save scene as .X file with texture and lightmap coordinates I used Panda DirectX Exporter. You can see results here (I have included MeshViewer for .X files from dx9sdk august 2k5). |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Aug 21, 2005 12:44 pm Post subject: |
|
|
Hmmm, that sounds really cool!
Thanks for the example! Just one question: how can I see if there are multiple layers in that file? You didn't provide any texures (or at least, there are no separate texture files and the mesh viewer doesn't show any textures), and as the .X file is binary I can't really see for myself. Can I somehow get that information from the Mesh Viewer? |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Sun Aug 21, 2005 4:20 pm Post subject: |
|
|
Baking in 3ds max was putting the results of x maps and operations onto 1 base texture. IE like in Deled, you could copy the texels of the triangles onto your lightmaps, then tint with the ambient light, then do the lighting operations on top. You have 1 baked texture layer.
-edit- holy typos |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Aug 21, 2005 7:40 pm Post subject: |
|
|
Are you seriously telling me 3DS max does texture baking? I thought we stopped using that technique somewhere during the nineties as it costs enormous amounts of texture memory to get a decent texture resolution |
|
Back to top |
|
|
|