Trouble with tuning HDR lighting on terrain - demo available

Started by
2 comments, last by thallish 16 years, 10 months ago
Hi I am trying to tune my HDR lighting on my terrain such that it runs perfectly but I am having trouble with the light adaption, and generally choosing the correct values. It behaves annoyingly, and it is to hard trying to explain what is matter with it[smile], so I have uploaded a demo here. I have an idea that it is because that the values in the sun in the skybox texture just is way to high compared to the rest of the sky and the terrain, but I do not know for sure and I do not really know how to fix it if it is that. Can someone try to run the project and try to see how it can be improved? To see the control scheme press F2. To change a value press the letter that is shown along with +/-. The HLSL shaders are also included in the project if anyone wants to take a look at them. oh yeah the control are standard WASD movement [Edited by - thallish on May 24, 2007 2:23:17 PM]
regards/thallishI don't care if I'm known, I'd rather people know me
Advertisement
I'm going to move this over to GP&T as it seems more suitable there.

Any chance of any screenshots? I'm not on my dev machine so I can't run any code, and I know quite a lot of members are warey about downloading/executing random code off the internet [smile]

The logarithm operators in a lot of tone-mapping algorithms try to compensate for small areas of extreme brightness (such as the sun) so make sure you're not using an implementation that approximates/eliminates this characteristic.

Also, bare in mind that Reinhard's operator is good and very GPU friendly but it's not the only operator (okay, I'm making an assumption about your technique, but seems 99.9% of people do it the same way [wink]). From my research it seems that one of the differentiators was the type of image they could handle - some being good for low-light, some outdoor, some artificial, some natural etc..etc..

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Hi

Yeah I'll try to post the entire solution instead of a demo executable tomorrow[smile]. I have some lighting to set up first. It seems like it has something to do with the difference in luminance, that the terrain and the sky values are very different and that is why the adaption is unnaturally changing from bright to very dark to quickly. So I have to light my terrain differently to correspond better to the skybox I have in the demo.

I'll post when that is done to let you know if any difference[wink].

I'll have a look for other tone map operators, if there are other better suited for outdoor terrain than Reinhard et. al?
regards/thallishI don't care if I'm known, I'd rather people know me
Ok I am lost in how to light my terrain properly

Here is what I do.

1) I have a skybox which I use as base for my terrain. In HDRShop mask out the sun and I create a diffuse filtered version and multiply with PI to get the irradiance. Now this is used as the ambient lightsource in the Phong lighting model.

2) For the diffuse light source, the sun I am lost in how to do it correctly. Right now I have created a irradiance map as in #1 with only the sun and add it to the ambient. If I remember correctly the value is already cosine weighted so no need to do this in the shader.

Is this the right approach?

The thing is that I get a very dark ground when I look down upon it thus it seems like the luminance is to small compared to the sky. Here is a couple of images.




How can this be mended? It is extremely annoying to watch.
And to those who are code interested I have a solution here.

Beware that load time is a little long do to some procedural content creation that is not being used right now and my terrain shader is cluttered with commented lines [smile]
regards/thallishI don't care if I'm known, I'd rather people know me

This topic is closed to new replies.

Advertisement