Lightmaps and Normal maps

Started by
6 comments, last by mikeman 19 years, 6 months ago
Simple question; Can you use both Lightmaps and Normal maps in a scene, or is that pointless? We want precalculated lightmaps for that Radiosity feel, since we (at the moment) only have static lightning. But at the same time, we want to use the Normal maps for the details in the lighting, those little cracks on the rocky slopes etc. However, the resolution of the Normal maps is alot higher that the shadow maps (we actually tile the Normal maps) and can't really be included when precalculating the lightning. Anyone have any ideas/suggestions/corrections?
Advertisement
I'm guessing you can interpolate between the two, no?

That should achieve the results you want.
Okay, let's say I use a pixel-shader to calculate a phong-lighting using the normal-map for each pixel. I then modulate this value with the lightmap, so that if the pixel is in shadow (from some other object) it won't light up.

Fine, but what if there are multiple light-sources? The lightmap could be well lit, when it's in fact in shadow from the sun, but lit by a neon sign nearby. The method above would give a nice diffuse+specular from the sun anyway.
I think Radiosity Normal Mapping is what u want.

it was developed by halflife 2 team(correct me if i m wrong), and u can find it on ATI's website.

what it basically does is to divide the radiosity illumination into 3 orthogonal bases, and at the runtime, interpolate the illumination in those 3 bases based on normals from the normal map. While it's not physically correct, it does give pretty good result.

Simple interpolation between lightmap and normalmap won't work, as interpolation between color(illumination) and vector(normal) is undefined
Well an interesting idea would be use the bump geometry when creating the light map, I think that solves all static lighting, but if it ever goes dynamic you can just apply the Normal maps. I guess what im trying to say here is make your map, insted of building it with flat walls(geometry) build it with the bump maps as geometry then reduce the vertex count. So you have low vertex maps and high vertex Lightmaps and Normal Maps. Anyway im not sure if im expressing this in in intellegent way or not, sorry :P
Quote:Original post by HippieHunter
Well an interesting idea would be use the bump geometry when creating the light map, I think that solves all static lighting, but if it ever goes dynamic you can just apply the Normal maps. I guess what im trying to say here is make your map, insted of building it with flat walls(geometry) build it with the bump maps as geometry then reduce the vertex count. So you have low vertex maps and high vertex Lightmaps and Normal Maps. Anyway im not sure if im expressing this in in intellegent way or not, sorry :P


I don't think it'll work well, as lightmaps tend to be low resolution(low frequency lighting).(because light mapping/radiosity is ususally used to simulate perfect diffuse material lighting, and the illumination over that kind of surfaces often changes very smoothly, and hardware texture filter can recover the illumination from low res light maps pretty well)
While to keep the geometric info from bump maps in lightmap generation stage, u need to have rather high res light maps.
As wanzi said, take a look at the presentation about Half-Life's "Normalmapped Radiosity". I read it yesterday, and it looks pretty good. Very good actually. I think this is what you are looking for.

My "question" on the above presentation is, how they handle the dynamic lights as the fire in one of the pictures, as well as the lighting on the monster (see animated/dynamic object). Maybe i didn't understood the whole concept well. Can somebody give any explanation how is this possible?

HellRaiZer
HellRaiZer
As others said, Radiosity Normal Mapping is the best choise for that. My own engine is based on that, and it looks pretty good. Basically you need 3 lightmaps, one for each of the T,B,N vectors, and then, in a shader, you use the normalmap and do a weighting between the 3 light values.

That's for static lights against static geometry. For dynamic geometry(characters&objects) and any type of lights, you just accumulate the lighting per-vertex and do the same trick. Again, you calculate 3 light values for each vertex in a vertex shader and interpolate them.

The most tricky part is dynamic lights against static geometry. I don't really know what they do in HL2, but in my engine, I keep the environment polycount in pretty low levels, so per-vertex lighting is not an option. For now, I just use standard bumpmapping for that. I'm thinking the option to build 3 dynamic lightmaps(maybe even low-res) for each frame and use them to do Radiosity Normal Mapping, but I haven't implemented that yet.


This topic is closed to new replies.

Advertisement