PDA

View Full Version : Dynamic Lightmaps



Rodrix
02-13-2007, 07:13 AM
I am rendering only outdoor environments with many plants (low poly high textured meshes with alpha test), skybox, and mountainbox, and I am targeting for something that can run fast on my GPU (GeForce FX5500 256MB, installed with latest drivers), which I consider a consumer card here in my country.

The problem I have is that my low-poly palms look very akward with vertex ligthing as the leafs of my plants contain very few vertices, so I was looking for a pixel-lighting solution.

Even though I found static lightmapping to be intresting, I was turned down by reading everywhere that it is an old dated approach. However, demos that used Phong lighting with shaders run extremelly slow on my computer. (by the way, do you consider my GPU to be very old in your country?)

1)Do you consider wise to use the following approach to lighting considering my needs? If else, what do you recommend?
Dynamic Lighting in OpenGL (http://www.3ddrome.com/articles/dynamiclightmaps.php)

2) Should I set the diffuse, and specular values of GL Lights to 0 when using lightmaps?

Thanks so much!
Cheers!
Rod

Jan
02-13-2007, 08:55 AM
Isn't the "FX" card of the Geforce 5 family the low-low-low end? If i remember correctly, there was a big speed-difference (especially with pixel-shaders) with Geforce 5 cards and Geforce 5 "FX" cards.

I would consider a Geforce 5 as a consumer card (here in Germany). I don't think it is a low-end card, but the FX variant might be pretty slow.

Jan.

Zengar
02-13-2007, 09:38 AM
There was no Geforce 5, it was called Geforce FX. They all have problems with pixel shaders, since they were designed with something else in mind.

Rodrix
02-13-2007, 11:41 AM
ok thanks for the note on the card!

And what about that approach on dynamic lightmaps, do you recommend it?

zeoverlord
02-13-2007, 02:05 PM
Well the FX5500 is on the low end for these kinds of things (i am assuming you want to so something like farcry).
So diffused static lightmaps for the ground, and static vertex lighting with the right light parameters (think lot's of ambient lighting) for the trees, nothing fancy.
Even then you are going to have a bit of a hard time to push all those fragments.

A step up from this would be to use a massive depth shadow texture that covers a large area + normal maps and stuff like that.
The FX cards can technically do this, but i don't know if it's something i would recommend.

Rodrix
02-13-2007, 02:52 PM
Wow the palms in FarCry are amazing!

How do they do that?

sqrt[-1]
02-13-2007, 05:38 PM
Originally posted by Rodrix:
Wow the palms in FarCry are amazing!

How do they do that? Switch the FarCry renderer to OpenGL mode (some config file) then use http://glintercept.nutty.org/ to grab some "debug" info? (XML frame grab mode)

jide
02-14-2007, 01:51 AM
Originally posted by Zengar:
There was no Geforce 5, it was called Geforce FX. They all have problems with pixel shaders, since they were designed with something else in mind. Could that explain the strange too enlightened results I had when doing some shadow mapping ?

And yes, there's no difference between geforce fx and geforce 5 but they are commonly called fx.

Rodrix
02-14-2007, 11:21 AM
Originally posted by sqrt[-1]:

Originally posted by Rodrix:
Wow the palms in FarCry are amazing!

How do they do that? Switch the FarCry renderer to OpenGL mode (some config file) then use http://glintercept.nutty.org/ to grab some "debug" info? (XML frame grab mode) mmm.. that sounds quite difficult... i think it will be difficult to actually find the answers in the debug info...

It's more simple, I'am not looking for the code they used, I was just wondering if you guys thought they were using either:
-pre-calculated static lightmaps OR
-real-time CPU-calculated (dynamic) lightmaps OR
-shader illumination OR
-real-time GPU-calculated (dynamic) lightmaps (if that exists...)

Thanks! :)

zeoverlord
02-14-2007, 04:53 PM
Actually far cry only uses a precalcylated texturemap (that includes lighting) for the ground.
On static objects they use simple static shadowmaps.
Trees have a only a fancy texture that is modulated by the incoming shadow samples from the texture map on the ground.
It's only on vehicles and characters they use any normal maps + ppl.
It's surprisingly simple, so it's it's all in the artists skilled hands.

You only have to play around with the editor for a few minutes.
http://img245.imageshack.us/img245/5874/fceditzc4.th.png (http://img245.imageshack.us/my.php?image=fceditzc4.png)
Look at the two trees i marked to the right, they are same trees in vegetation mode one of them have vertex lighting and the other one only ambient lighting, but the whole tree except the base is clearly in the light.

Rodrix
02-14-2007, 05:11 PM
Originally posted by zeoverlord:
Actually far cry only uses a precalcylated texturemap (that includes lighting) for the ground.
On static objects they use simple static shadowmaps.
Trees have a only a fancy texture that is modulated by the incoming shadow samples from the texture map on the ground.
It's only on vehicles and characters they use any normal maps + ppl.
Nice observations! I thought that trees would be lightmapped too...




Look at the two trees i marked to the right, they are same trees in vegetation mode one of them have vertex lighting and the other one only ambient lighting, but the whole tree except the base is clearly in the light. Sorry... I am kind of slow with this topics as I am just getting to know them. So are you implying that both trees you marked are vertex-lighted but the first one is shadowed by the generated shadowmaps?

Or did you mean that these guys just turn diffuse, and specular GL lighting off, and just change the ambient lighting for each tree depending if it's in the shadow?

Thanks so much in advance!
Rod

zeoverlord
02-14-2007, 11:27 PM
Yes i am, both are vertex lit.
What i think they do is just modulate the diffuse and specular parts of the vertex lighting with the shadow on the ground, the ambient lighting is the same for all objects.

They are actually all fully lit up when you place them and only when you hit the "build texture and shadow maps" button they get shaded, it is as if it decides what settings each tree should have then.

(And when you think about it a 64x64 shadow map times a whole island full of trees and plants is a lot of data.)

MZIskandar
02-14-2007, 11:38 PM
nice zeo.. i hope that the shadowing tutorial will be added on your website... those tanks tutorial are beautiful too... its very rare for people giving tutorial with beautiful models and textures..

Rodrix
02-15-2007, 01:37 AM
mmm.. that seems like a good posibility.

If there are no half-shaded half-lighted trees I guess we are on the right track.

And I suppose they must turn specular off, and just use diffuse, and specular produces shines on the textured triangles.... what do you think?

Thanks!

Rodrix
02-15-2007, 01:59 AM
...just checking... when you say "modulate" you just mean that they:
-get a pixel on the trees' ground and check how dark it is
-change the diffuse lighting of the tree according to this value
Correct?

Thanks so much! :)
Rod

zeoverlord
02-15-2007, 05:51 AM
More or less, i don't think they just sample a ground pixel from the texture(though that might work if the shadow map is separate), but rather do a whole new shadow test, either way it is all precalculated.

Modulate = multiply

Rodrix
02-15-2007, 06:27 AM
Originally posted by zeoverlord:
More or less, i don't think they just sample a ground pixel from the texture(though that might work if the shadow map is separate), but rather do a whole new shadow test, either way it is all precalculated.

Modulate = multiply Ohh! you mean they multiply the shadow map texture with the tree texture!? That sounds like a great idea!

What's the GL command for "modulation"? I suppose they use multitexture with a parameter for modulation?
Or what are the keywords I should use to search in google: "texture modulation"?

Thanks!!!