lightmapping + normal mapping.

Started by
4 comments, last by Guoshima 18 years ago
Hello people. My ideia is to integrate lightmapping with normal mapping rendering. Unfortenatly, I don't have the enought resources to make something similar to the HL2 technique. What I only have is perfectaly normal lightmaps (generated by Gile) and surfaces with normal maps. I need some sort of technique to blend them togheter. I does not have to be very precise ans should not have any pre-processing time (at least to complicated pre-processing). My ideia is only to have a bit of bump effect in my pre-lighted scenes. I have thought to do somethig like this: per fragment: float light = dot(normal, float3(0,0,1)); float4 final = albedo * (lightmap*2) * light; But this does not give a very good result. In fact, the result could be perfectaly baked on the albedo map instead of using a normal map. Any ideas?
Techno Grooves
Advertisement
if you want to know how HL2 does it: clicky

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Speaking of HL2 shading, do you know how ambient cube works/is computed? I know it's some sort of computing light intensity in each of 6 basis directions (+/- X/Y/Z), but i still don't get the point.

Filami, HL2 NM-radiosity works blending 3 lightmaps computed from 3 different directions (forming a known basis) using the normal on the fragment (look at the paper).
YengaMatiC for the people[Pandora's Box project]
The method I've used and I'm happy with the results, is to store the strongest light direction per vertex. Then:

a) calculate the light colour via the smoothed normal stored per vertex.
b) calculate the light colour via the bumped normal

Given these and the light maps were constructed using the smoothed normal an effective approximation is to add the difference between the two values (a and b) to the lightmap and then modulate with the diffuse.



mike

People, thanks to the anwser but I thinck you misunderstood me :p .
I know how HL2 shading works and in fact I know a bit how to generate those kind of lightmapping (at least I tyhinck I understand it). But, I don't have an editor, time to implement a radiosity solution specific for that case and gile does not generate that kind of lightmapping.<br>Solution:<br>- Not using bump mappping……<br>or<br>- Use a fake bumpmapping algorithm with the lightmapping generated by gile…..<br>or<br>- Not using lightmaps, use per pixel light (Doom3 like ilumination….. no radiosity solutions, fear :\ ).<br><br>For now, I may be thincking by not using bump mapping in the scenes and use in models.
Techno Grooves
well I presume you have max and the mental ray renderer ?

Then you can use Max and MaxScript to screw your normals before creating lightmaps using the Mental Ray renderer to generate the HL2 lightmaps. This works fine for us so far, allthough that I not really impressed by the normal mapped radiosity alone. You still have to add some per pixel lighting on top of it, or some CSM, POM or any other advanced per pixel effect to make your radiosity solution look good. But this was the only solution as far as I know which uses normal maps to compute the ambient illumination. You can perhaps also use PRT but this uses to many memory for us.

The ambient cubemaps are the easy part. Once you have your scene with lightmaps and everything, place a few dummy position in and editor, or max again, and from that position, render a cubemap (using only lightmaps, or light and diffuse, or perhaps with some extra illumination). Download the textures from you GPU and save them. Then use the ATI Cubegen tool to blur the cubemaps. Ingame sample the cubemaps with a little offset normal direction depending on your current position, to fake the infinity problem with cubemaps (see GPU Gems 1 - article 1), or a nVidia GDC presentation where they explain there demo's for some more information on this.

Regards,
Kenzo

This topic is closed to new replies.

Advertisement