Sign in to follow this  
Filami

lightmapping + normal mapping.

Recommended Posts

Filami    122
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[s]) 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?

Share this post


Link to post
Share on other sites
YengaMatiC    172
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).

Share this post


Link to post
Share on other sites
MikeArm    122
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

Share this post


Link to post
Share on other sites
Filami    122
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[s] does not generate that kind of lightmapping.
Solution:
- Not using bump mappping......
or
- Use a fake bumpmapping algorithm with the lightmapping generated by gile[s].....
or
- Not using lightmaps, use per pixel light (Doom3 like ilumination..... no radiosity solutions, fear :\ ).

For now, I may be thincking by not using bump mapping in the scenes and use in models.

Share this post


Link to post
Share on other sites
Guoshima    204
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this