Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exporting Light Maps in .X Files
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
Animeblood
Member


Joined: 25 Feb 2005
Posts: 12

PostPosted: Mon Jul 25, 2005 6:18 pm    Post subject: Exporting Light Maps in .X Files Reply with quote

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
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Mon Jul 25, 2005 6:23 pm    Post subject: Reply with quote

Hi there Anime! Smile 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
View user's profile Send private message Send e-mail Visit poster's website
Animeblood
Member


Joined: 25 Feb 2005
Posts: 12

PostPosted: Mon Jul 25, 2005 6:25 pm    Post subject: Reply with quote

Argh. Then how come Cshop files can be exported with .x and still have lightmaps. Sad ?
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Mon Jul 25, 2005 7:08 pm    Post subject: Reply with quote

Dunno, maybe he's using a different form of .x? Question
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Mon Jul 25, 2005 7:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ayufan
Member


Joined: 17 Jan 2005
Posts: 8

PostPosted: Fri Aug 19, 2005 9:50 am    Post subject: Reply with quote

No guys, you are wrong. X files can have more than one texture coordinate set.
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Fri Aug 19, 2005 10:31 am    Post subject: Reply with quote

That sounds great! Do you have more info (url) for us to look at?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ayufan
Member


Joined: 17 Jan 2005
Posts: 8

PostPosted: Fri Aug 19, 2005 10:44 am    Post subject: Reply with quote

You can simple use direct3dx for it.
Or: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/fileformat/xfileformat.asp
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Fri Aug 19, 2005 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ayufan
Member


Joined: 17 Jan 2005
Posts: 8

PostPosted: Fri Aug 19, 2005 1:11 pm    Post subject: Reply with quote

Yes I know, but for exporting you can create temporary direct3d device.
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Fri Aug 19, 2005 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ayufan
Member


Joined: 17 Jan 2005
Posts: 8

PostPosted: Fri Aug 19, 2005 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sun Aug 21, 2005 12:44 pm    Post subject: Reply with quote

Hmmm, that sounds really cool! Smile

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
View user's profile Send private message Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Sun Aug 21, 2005 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sun Aug 21, 2005 7:40 pm    Post subject: Reply with quote

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 Very Happy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum