• Create Account

# videl

Member Since 15 Aug 2012
Offline Last Active Apr 19 2016 03:28 AM

### In Topic: Best Place to learn 3D Computer Graphics?

08 January 2014 - 04:27 AM

If you want to learn opengl, this site is a great place to start: http://www.opengl-tutorial.org/

It really teaches "new" opengl and does not use any of the fixed function stuff. Of course you will also pick up some general graphics knowledge while following the tutorials ;)

### In Topic: General questions on hdr and tonemapping

08 September 2012 - 06:13 PM

Haha, I've been told by other programmers on our project that textures can't store negative numbers. Using R16_FLOAT works just perfect with negative numbers, thank you for the hint ;)

### In Topic: General questions on hdr and tonemapping

08 September 2012 - 06:51 AM

After implementing bloom and some other stuff I got back to my problem with the geometric mean. The problem is, that the render textures obviously can't store negative values. So I just got the value of 1 (the luminance texture is 0 if luminance < e, so I get exp(0) = 1,) for all dark average luminance values. The solution to this would be to map the luminance range to only positive numbers and then convert back to the real range in the exposure correction shader. I know this is done for example with normal maps. But as the range of values in the texture and luminances is not just [0..1] respectively [-1...1] it's not as easy as with normal maps.

My idea would be to define a lower bound for the log of a specific pixels luminance. Then add this value to the log to get only positive numbers. So if the lower bound would be -10, I would add 10 to the log of the luminance. And then substract 10 again just in the exposure shader.
Written in 'pseudocode' it would be something like this (although the shader does this quite different using several downsample blur passes):

sum = log(P1) + 10 + log(P2) +10 + log(PN) +10
sum = sum / N
->store to luminanceTex

lum = exp(luminanceTex - 10)
...

I hope that makes it clear what I have in mind.

Edit/ this approach seams to work, any better ideas though?

### In Topic: General questions on hdr and tonemapping

17 August 2012 - 12:39 PM

Ok, then I will try log and exp.

I am currently implementing a bloom effect, let's see how far I can push the image as a whole. This will require me to completely separate the process of exposure correction and tonemapping. At the moment the pipeline is the following: forward render the image -> downsample to get luminance -> correct exposure and tonemap in one shader
I think I will have to adjust it to: forward render the image -> downsample to get luminance -> correct exposure -> create bloom -> add bloom to render result and tonemap.

### In Topic: General questions on hdr and tonemapping

16 August 2012 - 03:37 AM

@jefferytitan Yes I got the information about the geometric mean from the blog post you mentioned.

To calculate the geometric mean, I simply calculate the log of luminance and write the results to a 1024×1024 texture. I then call GenerateMips to automatically generate the full mip-map chain. At that point I can apply exp() to the last mip level to get a full log-average of the scene.

That's exactly what I am doing right now (except I am downsampling using custom shaders and not the mip mapping function). I am not sure which base I should use for the log and exp. Default log and exp functions are using e. Somehow there must also be a error in my code, using the geometric mean the exposure control does really not help to brighten dark areas. But it works using the arithmetic mean...

@MJP
Ok, separating exposure control and tonemapping makes sense. I've also read the article on John Hable's Blog. He does also separate the exposure correction and the tonemapping I think.

In your demo application (which is very useful ;)) you have a slightly more advanced algorithm to control the exposure. You do also use the geometric mean, right?
Controlling the mood is essential yes. In your application that is the keyValue slider I suppose.

I will take a look at this book, I've already found two of the presentations and your blog article before ;)

PARTNERS