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 

LIghtmapping question???

 
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
mobeen
Member


Joined: 26 Sep 2005
Posts: 34

PostPosted: Sat Oct 15, 2005 9:02 am    Post subject: LIghtmapping question??? Reply with quote

Hello all DeleDians
I have made a 3d level loader in DirectX. I have made lightmaps in DeleD Lite and now want to incorporate them in the DX app. My questions are
1) I have seen the lightmaps generated in the liightmaps sub folder under textures. How do i apply these to my DX app. DO i have to do multitexturing or what?
2) Can DeleD bake the lightmap in the texture or mesh?
3) How can i view the same view n DX App? The info given in my texture is tiled differently to that given in the lightmap so how can this be done?

Let me know asap.
Thanx in advance
Mobeen
Back to top
View user's profile Send private message
Mr.Fletcher
DeleD PRO user


Joined: 07 Aug 2004
Posts: 1772
Location: Germany

PostPosted: Sat Oct 15, 2005 5:08 pm    Post subject: Reply with quote

Hello, i'm an OpenGL guy, but basically, the process is the same.
1) You need to use multitexturing, yes. On the first texture unit, you bind the actual texture and on the second the lightmap. But don't ask me how this is beeing handled in dx Wink
2) DeleD can't bake it in the texture and this would be against the philosophy of lightmapping, for you will need an extra texture for each polygon, which will end in an huge size of your texture folder Wink
bake it in the mesh -> i don't know what you mean
3) I'm not sure if i get your question correctly, but the lightmap texture coordinates for each vertex are stored in the lightmap line, see the file format explanation.

I hope I could help you Smile
_________________
Behold! The DeleD Wiki! Please help us expanding it Smile
DeleD on IRC
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


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

PostPosted: Sat Oct 15, 2005 9:02 pm    Post subject: Reply with quote

Hmmm... well, I couldn't have said it any better than that, really Smile
Back to top
View user's profile Send private message Visit poster's website
Sindwiller
DeleD PRO user


Joined: 25 May 2005
Posts: 331
Location: Zürich. Switzerland

PostPosted: Sun Oct 16, 2005 8:18 pm    Post subject: Reply with quote

Quote:
bake it in the mesh


I think he mean's that DeleD should store Lightmapping Data/the Image in the Mesh itself like other Model/Levelformats and Worldeditor's do.

wfg, Sindwiller
Back to top
View user's profile Send private message
Jeroen
Site Admin


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

PostPosted: Mon Oct 17, 2005 6:14 am    Post subject: Reply with quote

I do not understand how you can bake an image "in the mesh itself". How does that work?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mobeen
Member


Joined: 26 Sep 2005
Posts: 34

PostPosted: Mon Oct 17, 2005 6:28 am    Post subject: Re: Reply with quote

Mr.Fletcher wrote:
3) I'm not sure if i get your question correctly, but the lightmap texture coordinates for each vertex are stored in the lightmap line, see the file format explanation.

Can you tell me where this info regarding lightmapping tex coords is given?

Sindwiller got my point. I think i was unable to frame my question correctly. Let me give an example I have three textures of size 256x256 which I have applied to Floor, Ceiling and Walls as shown below.



I place my lights in DeleD and generate lightmaps. I get the lightmaps from the lightmaps folder. Now the lighmap info does not correspond exactly to the texture. I dont know which vertex coordinates take which lightmap pixel. Where is the lightmap mapping info stored?
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


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

PostPosted: Mon Oct 17, 2005 7:48 am    Post subject: Reply with quote

Inside the .dmf file format, u,v coordinates are provided at the end of each polygon definition. For multi-layer materials, there are multiple sets of coordinates. The lightmap information is always stored in the last layer.

For example, let's take the following polygon definition
Code:

3;30;0;1;5;-1.0000;1.3750;-1.7500;1.3750;-1.7500;1.3130;0.0137;0.0020;0.0020;0.0020;0.0020;0.0137;


From left to right:
- there are 3 vertices in this polygon
- using material 30. This material contains lightmap information (material definition not shown here)
- with vertex indices 0, 1 and 5. For the corresponding coordinates, do a lookup in the vertice-list with those indices.
- next up: 3 pairs of u,v coordinates (6 floats in total), corresponding with the mapping of the first texture layer on the vertices
- and last but not least: 3 pairs of u,v coordinates, corresponding with the mapping of the lightmap.

Does that make sense now?
Back to top
View user's profile Send private message Visit poster's website
mobeen
Member


Joined: 26 Sep 2005
Posts: 34

PostPosted: Tue Oct 18, 2005 9:17 am    Post subject: Thanks for the info Reply with quote

Paul-Jan wrote:
Inside the .dmf file format, u,v coordinates are provided at the end of each polygon definition. For multi-layer materials, there are multiple sets of coordinates. The lightmap information is always stored in the last layer.

For example, let's take the following polygon definition
Code:

3;30;0;1;5;-1.0000;1.3750;-1.7500;1.3750;-1.7500;1.3130;0.0137;0.0020;0.0020;0.0020;0.0020;0.0137;


From left to right:
- there are 3 vertices in this polygon
- using material 30. This material contains lightmap information (material definition not shown here)
- with vertex indices 0, 1 and 5. For the corresponding coordinates, do a lookup in the vertice-list with those indices.
- next up: 3 pairs of u,v coordinates (6 floats in total), corresponding with the mapping of the first texture layer on the vertices
- and last but not least: 3 pairs of u,v coordinates, corresponding with the mapping of the lightmap.

Does that make sense now?

Sure it makes sense now the help file brushed on this in the last para with most of issues cryptic thanx again.
Mobeen
Back to top
View user's profile Send private message
Jeroen
Site Admin


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

PostPosted: Tue Oct 18, 2005 9:45 am    Post subject: Reply with quote

I'll make sure to update the Help with the explanation PJ provided here! Very Happy
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: Tue Oct 18, 2005 6:02 pm    Post subject: Reply with quote

Glad to hear that piece of info works for you, looking forward to seeing more of your work! Smile
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
Page 1 of 1

 
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