View previous topic :: View next topic |
Author |
Message |
mobeen Member
Joined: 26 Sep 2005 Posts: 34
|
Posted: Sat Oct 15, 2005 9:02 am Post subject: LIghtmapping question??? |
|
|
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 |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Sat Oct 15, 2005 5:08 pm Post subject: |
|
|
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
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
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 _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Oct 15, 2005 9:02 pm Post subject: |
|
|
Hmmm... well, I couldn't have said it any better than that, really |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
Posted: Sun Oct 16, 2005 8:18 pm Post subject: |
|
|
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 |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Mon Oct 17, 2005 6:14 am Post subject: |
|
|
I do not understand how you can bake an image "in the mesh itself". How does that work? |
|
Back to top |
|
|
mobeen Member
Joined: 26 Sep 2005 Posts: 34
|
Posted: Mon Oct 17, 2005 6:28 am Post subject: Re: |
|
|
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 |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Mon Oct 17, 2005 7:48 am Post subject: |
|
|
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 |
|
|
mobeen Member
Joined: 26 Sep 2005 Posts: 34
|
Posted: Tue Oct 18, 2005 9:17 am Post subject: Thanks for the info |
|
|
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 |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Tue Oct 18, 2005 9:45 am Post subject: |
|
|
I'll make sure to update the Help with the explanation PJ provided here! |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Tue Oct 18, 2005 6:02 pm Post subject: |
|
|
Glad to hear that piece of info works for you, looking forward to seeing more of your work! |
|
Back to top |
|
|
|