use one image as objectlightmap for many statics..

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

use one image as objectlightmap for many statics..

Post 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.
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

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

Post 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.
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

AWESOME

I can use this for cars too.


U rock... As ever.
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post 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??
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post 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..?
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post 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..
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

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

Post 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.
ImageImageImage
I have cameras in your head!
reegad
Posts: 82
Joined: Mon Nov 09, 2009 3:43 pm

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

Post 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
Image
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

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

Post by Apache Thunder »

Lightmap will always override that. No way around it sorry.
ImageImageImage
I have cameras in your head!
reegad
Posts: 82
Joined: Mon Nov 09, 2009 3:43 pm

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

Post 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
Image
Post Reply