Skybox Lighting
Hi, i´m not sure how this technique is called,
but i want to light my outdoor scene according to the surrounding skybox.
That is, for example, a reddish sky causes the scene to be lit reddish as well. Hmm, i hope you know what i´m mean.
I have read something about this method on the net, and they use HDRI for this.
But i want to do it without HDRI.
Can someone tell me how this could be done?
and sorry for my bad english i´m out of training :(
thanks
Gammastrahler
Hmmm,
i think you mean (Environment) Cube Mapping? That´s not what i want, since this does reflections on the surface.
I want only diffuse interaction.
i think you mean (Environment) Cube Mapping? That´s not what i want, since this does reflections on the surface.
I want only diffuse interaction.
I'm afraid it's not really possible. But you can use the following trick :
Since the sky occupy the top of your skybox, you can have a function that lock the texture applied on the top of your skybox, and compute the average color of this texture. This will gives the average color of your sky, and you could use it with a standard directional light.
Since the sky occupy the top of your skybox, you can have a function that lock the texture applied on the top of your skybox, and compute the average color of this texture. This will gives the average color of your sky, and you could use it with a standard directional light.
From the original cubemap, create a new cossine weighted cubemap (this can be of much lower resoultion).
Then just use your normal as texture coord for this new cubemap.
ATI has a normalmap tool that can perform the filtering.
Doing the filtering in realtime is alot harder.
Every texel in the filtreed cubemap needs to consider half of the pixels in the original map.
Edit: You do not need HDR or anything like that to use this technique. It works even on GeForce1 cards and kan look really nice. It's only a precomuptation, like this:
Another way to think of it is to treat every texel on the cubemap as a distant light, then do the normal diffuse lighting for a pixel using all these lights.
Combined with ambient occlusion it looks quite nice.
As for the name, I call it hemisphere lighting, dunno if it's the correct term for it.
Then just use your normal as texture coord for this new cubemap.
ATI has a normalmap tool that can perform the filtering.
Doing the filtering in realtime is alot harder.
Every texel in the filtreed cubemap needs to consider half of the pixels in the original map.
Edit: You do not need HDR or anything like that to use this technique. It works even on GeForce1 cards and kan look really nice. It's only a precomuptation, like this:
* For every possible normal on a sphere = every texel on the destination cubemap* Light = 0* Sum = 0* For every texel on the original cubemap* K = Calculate the dot product between the two normals.* If K is less than zero, skip further processing of this texel (this rejects about 50% of the texels)* Light += Color of the original cubemap at texel * K* Sum += K;* Light /= Sum* Store Light at the destination texel.
Another way to think of it is to treat every texel on the cubemap as a distant light, then do the normal diffuse lighting for a pixel using all these lights.
Combined with ambient occlusion it looks quite nice.
As for the name, I call it hemisphere lighting, dunno if it's the correct term for it.
Hey,
eq is right. You could also take a look at this paper: http://graphics.stanford.edu/papers/envmap/
It has a nice, fast way of computing an irradiance map from the original environment map. But in this case, we're only dealing with ambient and diffuse lighting. If you want specular, you can easily get good results by using a blurred version of the original environment map. How much blur you apply defines the general "glossiness" of specular reflecting surfaces. You can further modulate this in each material by using a gloss map too.
Hope that helps.
eq is right. You could also take a look at this paper: http://graphics.stanford.edu/papers/envmap/
It has a nice, fast way of computing an irradiance map from the original environment map. But in this case, we're only dealing with ambient and diffuse lighting. If you want specular, you can easily get good results by using a blurred version of the original environment map. How much blur you apply defines the general "glossiness" of specular reflecting surfaces. You can further modulate this in each material by using a gloss map too.
Hope that helps.
This might be of interest to you:
Hemisphere Lighting With Radiosity Maps
They are using a texture lookup to control the ambient lighting term. They use a single color for the sky and sample their ground color, but you could sample a sky color as well.
You may need to register to read the article. If you don't have a gamasutra account, try BugMeNot.
Hemisphere Lighting With Radiosity Maps
They are using a texture lookup to control the ambient lighting term. They use a single color for the sky and sample their ground color, but you could sample a sky color as well.
You may need to register to read the article. If you don't have a gamasutra account, try BugMeNot.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement