[?] Re-using lightmaps

Making or wanting help making your own asset? Check in here
Post Reply
Onil
Posts: 1232
Joined: 2007-08-19 09:50

[?] Re-using lightmaps

Post by Onil »

I was wondering if it would be possible to re-use the existing light-maps even though the static has been moved.

I looked into the tai file and it seems that the coordinates of the static are there:

=00=-1000=25=391 = -1000.000/25.000/391.000 (which aren't the exact coordinates but pretty close) And I believe the 00 value might be the rotation.

However when I update the coordinates slightly according to how the static was moved, it still doesn't load the light-map for it. Even if its just a small adjustment in height for example.

So any ideas if this is doable? Would definitely come in handy!
Image
BroCop
Posts: 4155
Joined: 2008-03-08 12:28

Re: [?] Re-using lightmaps

Post by BroCop »

Not sure if thats even possible but, assuming that all you did was rename the object LM files, have you tried regenerating the LM atlas files?
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [?] Re-using lightmaps

Post by Rabbit »

CroCop wrote:Not sure if thats even possible but, assuming that all you did was rename the object LM files, have you tried regenerating the LM atlas files?
He can't. Its from Dovre and he doesn't have all the original lightmap files to merge into a atlas.
Image

AfSoccer "I just don't see the natural talent."
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [?] Re-using lightmaps

Post by Rhino »

yes very doable. The =00= value is in fact its geom and lod, geom0, lod0, =10= would be geom1 (wreck geom on dest statics), lod0, =04= is geom0, lod4.

If its for ingame use then you need to update more than just the .dds texture, you need to also update the .tai file. Also its rounded down to no decimal places, not an exact number, so even if its 25.9999999 (although the BF2 editor doesn't save to that accuracy) it would still be "25" on the LM file location.

Its also possible to have multiple items, or even lods of the same object (provding they all have the same LM UVs, which pretty much no statics do, not even most with custom LM UVs) to all use the same LM but you need to code them manually. If you look at my Falklands LM files you will see things like the Static Terrain LM Patches are all using the same LM file for each lod, like so:

Code: Select all

levels/the_falklands/lightmaps/objects/falklands_waterplane=00=0=18=0.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas0.dds, 0, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_waterplane=01=0=18=0.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas0.dds, 0, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/argentina_c01=00=-11700=0=-10000.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas1.dds, 1, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/argentina_c01=01=-11700=0=-10000.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas1.dds, 1, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/argentina_c01=02=-11700=0=-10000.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas1.dds, 1, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/argentina_c01=03=-11700=0=-10000.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas1.dds, 1, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_nw01=00=-1500=0=1200.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas2.dds, 2, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_nw01=01=-1500=0=1200.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas2.dds, 2, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_nw01=02=-1500=0=1200.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas2.dds, 2, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_nw01=03=-1500=0=1200.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas2.dds, 2, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_se01=00=874=0=-984.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas3.dds, 3, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_se01=01=874=0=-984.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas3.dds, 3, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_se01=02=874=0=-984.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas3.dds, 3, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_se01=03=874=0=-984.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas3.dds, 3, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_sw01=00=-2200=0=-299.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas4.dds, 4, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_sw01=01=-2200=0=-299.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas4.dds, 4, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_sw01=02=-2200=0=-299.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas4.dds, 4, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_sw01=03=-2200=0=-299.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas4.dds, 4, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_ne01=00=2249=0=679.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas5.dds, 5, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_ne01=01=2249=0=679.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas5.dds, 5, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_ne01=02=2249=0=679.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas5.dds, 5, 0, 0, 1, 1
levels/the_falklands/lightmaps/objects/falklands_ne01=03=2249=0=679.dds		levels/the_falklands/lightmaps/objects/LightmapAtlas5.dds, 5, 0, 0, 1, 1
Last edited by Rhino on 2014-01-07 22:58, edited 1 time in total.
Image
Onil
Posts: 1232
Joined: 2007-08-19 09:50

Re: [?] Re-using lightmaps

Post by Onil »

So if I want to use the original lightmap for a specific static that I moved slightly and lost its lightmap, how you I do that? Cause I tried updating its coordinates on the tai file but that didn't work.
Image
Rudd
Retired PR Developer
Posts: 21225
Joined: 2007-08-15 14:32

Re: [?] Re-using lightmaps

Post by Rudd »

the coords are nearly the same as in the staticobjects file however iirc the atlas coordinates are to the nearest lower whole number, so translate the coords from the staticobjects and it should pick it up
Image
Onil
Posts: 1232
Joined: 2007-08-19 09:50

Re: [?] Re-using lightmaps

Post by Onil »

Isn't that the same as simply ignoring the numbers after the dot? Cause that's what I did and it still didn't use the original lightmap. But I will try it again later on, maybe I missed something.
Image
Post Reply

Return to “PR:BF2 Community Modding”