Page 1 of 1

use one image as objectlightmap for many statics..

Posted: Tue Sep 14, 2010 10:08 pm
by fo0k
but.. not create a copy of each image for each static..?

so I have a few hundred trees... and a lightsource that is essentially directly above.. so I have generated a lightmap in 3dmax and it looks good.. I can use the same lightmap for every tree in the map.

however, it looks like I need to create 100's of copies of this lightmap image in my objectlightmaps folder each with the coordinates of each tree...

Boring.... very...

Any way to have multiple statics use one lightmap?


I doubt it.. but thought Id ask.

Re: use one image as objectlightmap for many statics..

Posted: Wed Sep 15, 2010 12:57 am
by Apache Thunder
You could try making the trees PCOs and have them use a global lightmap. (once they are PCOs, place the single lightmap in a identical ObjectLightmaps folder but put it in the texture rfa of your mod instead). Only difference is the file name does not include the position cooridents. Just the geometry template. :P

A few of the ships in vanilla BF42 are lightmapped like this.

Re: use one image as objectlightmap for many statics..

Posted: Wed Sep 15, 2010 1:28 am
by fo0k
AWESOME

I can use this for cars too.


U rock... As ever.

Re: use one image as objectlightmap for many statics..

Posted: Wed Sep 15, 2010 1:32 am
by fo0k
So by using this technique and also adding alternate texture directory to the main init, it could be a way to achieve bik video lightmaps??

Re: use one image as objectlightmap for many statics..

Posted: Wed Sep 15, 2010 11:02 pm
by fo0k
Havent managed to get the bik working yet.. looks doubtful (*said in anticipation of provoking a solution) but otherwise, this is freeking awesome for vehicles... 7 years on a driving mod for 42 and didnt twig you could lightmap the cars.

It was a tear to the eye bf moment. They are so pretty now! All 15 poly's of them!

but i want it to look in the movies folder... for a bik..

I have mentioned this before.. but Ill say it again.

I want one global bik (lightmap to use on - e v e r y t h i n g - buildings, vehicles, player models, terrain, skybox, weapons... everything.

The bik is just a mid shaded colour but has occasional lightning style flashes..

Im sure you get my drift.. epic lightning lighting map wide..

so far..

Terrain (via detail map) Possible
Skybox Possible
Statics - not possible
PCO's (which now includes all statics for the sake of this map) Perhaps..?

Re: use one image as objectlightmap for many statics..

Posted: Thu Sep 16, 2010 1:22 am
by fo0k
in a bid to spam my own thread..

I guess the above could be achieved by making the main texture the bik video.. and then making individual lightmap textures for each object type which would actually be the normal visual texture..

Re: use one image as objectlightmap for many statics..

Posted: Thu Sep 16, 2010 3:01 am
by Apache Thunder
You could use 3DS Max to lightmap each mesh with no lightsources in the scene (thus have them all normal range). You would then use the "complete map" option when selecting the map type prior to rendering the lightmaps. Then you would end up with texture for the mesh but on the chl3 uvmap instead. Then copy the chl3 uvmap to chl1. Then use your main texture as the lightmap and the BIK as the animated lightmap? So basically you lightmap in reverse. Lightmapping the chl1 uvmap instead of the chl3. Main texture on chl3, and lightmap with BIK animation on main texture which is then defined via the RS file.

Re: use one image as objectlightmap for many statics..

Posted: Sun Sep 19, 2010 12:36 am
by reegad
Awesome! got this working!
Any idea if its possible to make them still react to the standard lighting, and at the same time use a lightmap? i put lighting true; on.
Its a static, and doesnt seem to care if its sunny on 1 side and darky on the other.. any ideas?

Example:
You on the right side there, the building should be a bit darker/shaded, but is not.. lighting is set to true, but it also uses the lightmap.
Image

Re: use one image as objectlightmap for many statics..

Posted: Sun Sep 19, 2010 4:27 am
by Apache Thunder
Lightmap will always override that. No way around it sorry.

Re: use one image as objectlightmap for many statics..

Posted: Sun Sep 19, 2010 12:49 pm
by reegad
Crapsickles!
Ah well, i'll guess the best way would be to then be to actually render to the texture, beacuse it just looks silly with a static that is'nt shaded on the dark side..
(lol.. the dark side)

Edit:
Baked to texture.. actually looks pretty good, and the standard lighting also makes it the right color and shaded.
Just a low-res test
Image