# Lighting questions

This topic is 4124 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok I am trying to understand some radiometry terms to get the lighting in my demo correct. First of all is doing a diffuse convolution of an image equal to creating an irradiance map? I am using HDRShop and I creating a diffuse convolution of the image I use as a sky to light my terrain, or rather I have two different maps. I am creating two different images to use for ambient and diffuse lighting. First I take my image and mask out the sun, and do a diffuse convolution on the it. This is used as a lighting intensity in the ambient component of my Phong lighting model. This way the ambient component correctly represent the light from the sky. I then get the fraction of the reflected light and divide by PI to get the reflected radiance.
// calculate ambient lighting contribution
float3 realAmb = texCUBE( SkyIrradianceMapSampler, normal ) ;

// divide by PI to get radiance
float3 amb = ( albedo * realAmb ) / PI;
Next I create an image with only the sun in it. I now do a diffuse convolution on it and end up with a term I can use as the intensity of the light in the diffuse component of the Phong lighting model. This way the sun is modeled correctly. I add the normal from my bumpmap to the face normal and look up in the diffuse convoluted (irradiance?) map, get the fraction of reflected light and divide by PI to get the outgoing radiance.
// get bump normal
float3 bumpNormal = tex2D( SurfaceNormalMapSampler, tex );

// calculate the diffuse lighting contribution
// divide by PI to get radiance
float diff = ( albedo * texCUBE( SunIrradianceMapSampler, normalize( bumpNormal + normal ) ) ) / PI;
Is this the correct approach?

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
17
5. 5

• 9
• 33
• 13
• 12
• 10
• ### Forum Statistics

• Total Topics
632577
• Total Posts
3007157

×