Jump to content

  • Log In with Google      Sign In   
  • Create Account

HDR + Tonemapping + Skylight = Fail?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
53 replies to this topic

#41 Hodgman   Moderators   -  Reputation: 30384

Like
1Likes
Like

Posted 31 August 2012 - 10:20 PM

How does your bloom effect work?

Sponsor:

#42 riuthamus   Moderators   -  Reputation: 5497

Like
1Likes
Like

Posted 01 September 2012 - 01:28 AM

Well... i convinced him to make a slider system so we could control the settings... and.... we came up with the following:

Posted Image

Now this looks rather good so far, but there are certain lighting scenarios where that blur just goes ape shit again. This new control system we setup really helps.... curious if we could do, On the fly editing of it... hm....

Anyway, we also fixed the auto exposure setting, once we get some shadows in ( another issue ) we are going to be in business!

Posted Image

#43 Telanor   Members   -  Reputation: 1333

Like
0Likes
Like

Posted 01 September 2012 - 03:46 AM

How does your bloom effect work?


Its the same as in the sample. It takes the 1/16 size image, applies a bright pass, blurs it, then upsamples it to 1/2 size to pass on to the tone mapping. The only problem now is the kind of odd color bias. Some colors recieve bloom, others don't. Specular highlights are also recieving no bloom. Are specular highlights supposed to have light values > 1?

Also, the auto-exposure adjustment seems to be too good. If your in a dark setting, it adjusts the lighting all the way up until it looks like daylight again. How can we control it so we can still have dark scenes...?

#44 quiSHADgho   Members   -  Reputation: 325

Like
1Likes
Like

Posted 01 September 2012 - 05:08 AM

Honestly I don't have any idea why you experiencing those strange issues. I'm using the same bloom effect and think it looks good and the speculars receiving bloom. But I don't know your lighting system maybe your specular exponents are to high. And what is your luminance convert constant? Usually blue is about 0.1 or something while RG is 0.5, 0.7... Turning up the blue value could help eventually or its just a stupid thought.

Also, the auto-exposure adjustment seems to be too good. If your in a dark setting, it adjusts the lighting all the way up until it looks like daylight again. How can we control it so we can still have dark scenes...?


Few days ago I got a similar problem but more extreme. In shadows it just burned all colors until the whole screen was white and sometime even more until all colors got negated. Then I worked on a few other features and ended up with a new lighting system and need to overhaul my HDR code. While reseaching I found this article
(http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/) about tone mapping whick actually helped me alot. So I have rewritten my whole tone mapping code and now its working as its supposed to and I'm pretty sure there was a mistake in my previous tone mapping code.

#45 Telanor   Members   -  Reputation: 1333

Like
1Likes
Like

Posted 03 September 2012 - 03:29 AM

What kind of values are you using for your sun light and sky? I've implemented the new tonemapping (using the filmic ALU one) and now everything is pretty dark.

RuinValor 2012-09-03 05-22-57-42.png

#46 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 03 September 2012 - 11:02 AM

I personally like the look, we just need to find a way to fix the highlights of brighter colors. When we place sand it shoudl be brighter. Would luminance do that? again i like this new color and tone as it is very rich in color! We just need to figure out how to get sand and such to highlight now. Thank you guys for your continued help. I am seriousl going to put an advert for gamedev.net when we make the game playable.

#47 quiSHADgho   Members   -  Reputation: 325

Like
0Likes
Like

Posted 03 September 2012 - 02:50 PM

What kind of values are you using for your sun light and sky? I've implemented the new tonemapping (using the filmic ALU one) and now everything is pretty dark.


Just the standart values I was using before HDR with slight adjustment in ambient light and a bit more lightpower. But I experienced this too and turning down the maximum white value helps alot. Turning it down to 1 - 1.5 works great for me.

I personally like the look, we just need to find a way to fix the highlights of brighter colors. When we place sand it shoudl be brighter. Would luminance do that? again i like this new color and tone as it is very rich in color! We just need to figure out how to get sand and such to highlight now. Thank you guys for your continued help. I am seriousl going to put an advert for gamedev.net when we make the game playable.


Do you use some sort of material shader? Different light values like diffuse color or a multiplier could do the job to boost the values of some blocks while leaving the rest untouched. You could also experiment with specular exponents but in my opinion it makes it look unnatural when the exponent gets to small. Tweaking your textures may help too. Sometimes good looking textures with LDR look bad with HDR.

Edited by quiSHADgho, 03 September 2012 - 02:51 PM.


#48 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 04 September 2012 - 04:04 AM

Do you use some sort of material shader? Different light values like diffuse color or a multiplier could do the job to boost the values of some blocks while leaving the rest untouched. You could also experiment with specular exponents but in my opinion it makes it look unnatural when the exponent gets to small. Tweaking your textures may help too. Sometimes good looking textures with LDR look bad with HDR.


Certainly, well we switched some things around and finally added in filmics system and got a very desirable effect overall and even got specular blur working! YEAH!!, now our issue is our skybox, everything looks great except for the skybox is being destroyed by the entire process. (we are getting a very washed out color even though I have a vibrant one in the settings )

It is key to note that we are not using a texture for the skybox. This enables us to control the color of the sky manually at any point in the day and create transitions from one color to the next. The only aspect that is an image is the sun and the moon, so we are kinda at a loss as to how we could fix this. We have attempted to change the lighting multiplier for the sky and other things but ultimately the result is a washed out color.

Any ideas as to how we could get the sky to either be a rich vibrant color, or how to make it bypass the entire process all together? This system is proving to be the most troublesome.... and rather annoying. We still have an issue with the auto exposure correction as well. We are unsure of where to modify the values that control how much of it works... so when you go into a dark region the outside becomes... daytime! lmao

While funny at first it is proving to be annoying in many cases. Here are some screenshots, btw I want to thank you guys for all this help. I hate how much of a bother we are being but this is like pulling teeth for us since none of us have ever coded an HDR setup before.

Exposure issue:
Posted Image

and the sky issue:
Posted Image

Edited by riuthamus, 04 September 2012 - 04:38 AM.


#49 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 04 September 2012 - 04:46 AM

Actually.... i just changed the values to a more rich version of the color... and i got some very nice results. I think this is why i could never understand it. I need to pick colors that compensate for the HDR... hm....

Posted Image

So at this point our only issue is the auto exposure. Does anybody have any good tutorials for this? maybe we are using one that has no settings. We simply need to find a way to clamp the value and change how much it does or doesnt bloom out... sadly my knowledge on this system is very much lacking. Thanks for any direction or help you can provide. I think after we are done with this I am going to work on an article that describes our path and how we got to the final result.

#50 Hodgman   Moderators   -  Reputation: 30384

Like
1Likes
Like

Posted 04 September 2012 - 05:10 AM

In my last game, we simply gave the artists a minimum and maximum value that would be applied to the "average scene luminance" step.
e.g. the artists might say min=0.5, max=10, and then if the average is calculated to be 0.1, it will be increased to 0.5.

We found this to be a simple way to stop the auto-exposure making every different scene look the same.

#51 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 04 September 2012 - 05:21 AM

In my last game, we simply gave the artists a minimum and maximum value that would be applied to the "average scene luminance" step.
e.g. the artists might say min=0.5, max=10, and then if the average is calculated to be 0.1, it will be increased to 0.5.

We found this to be a simple way to stop the auto-exposure making every different scene look the same.


That is hard for me to understand. Sorry, this is our first game so the industries terminology is lost upon me! can you explain a bit further of what that means?

#52 Hodgman   Moderators   -  Reputation: 30384

Like
1Likes
Like

Posted 04 September 2012 - 05:24 AM

In your tonemapping shader, you've got something like:
float avgLum = tex2D( ... );
You can put limits on it by adding something like:
avgLum = min( 10.0, max( 0.5, avgLum ) );
This will constraint how much the tone-mapper can adjust for very bright or very dark scenes.

[edit] Though instead of hard-coding those numbers, you can make them variables that are controlled by a slider, and have your artists choose suitable values.
In our game, we used different values for day-time, night-time, raining, etc...

Edited by Hodgman, 04 September 2012 - 05:48 AM.


#53 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 04 September 2012 - 05:36 AM

In your tonemapping shader, you've got something like:

float avgLum = tex2D( ... );
You can put limits on it by adding something like:
avgLum = min( 10.0, max( 0.5, avgLum ) );
This will constraint how much the tone-mapper can adjust for very bright or very dark scenes.


Oh, i thought you said you limited the artist. my bad!

#54 riuthamus   Moderators   -  Reputation: 5497

Like
0Likes
Like

Posted 06 September 2012 - 11:39 AM

Well, i want to say thank you to everybody for this. We have finished the system and it looks pretty good. Still working on some lighting changes and some texture work to compensate for the new system but overall a great look. Thank you to everybody.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS