• Advertisement
Sign in to follow this  

HDR rendering pipeline

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! How exactly HDR rendering proces should look like? Here's the image I've found (taken from this article): HDR pipeline But: - if HDR scene texture is used for the brightpass, then brightpass texture is not influenced by exposure (or as it is originally in Reinhard's paper - "key")? so changing the exposure (key) parameter in tone mapping pass, won't make the final bloom larger/smaller? - also if the bloom texture is added to the original HDR scene texture before tone-mapping pass, it will increase average luminance of the scene, influencing tone-mapping pass itself I was experimenting a bit with jollyjeffers' HDR demo (actually with its MDX port), but i just can't get it right. Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Quote:
if HDR scene texture is used for the brightpass, then brightpass texture is not influenced by exposure (or as it is originally in Reinhard's paper - "key")? so changing the exposure (key) parameter in tone mapping pass, won't make the final bloom larger/smaller?


That seems to be the case. Exposure just brightens or darkens the scene in this implementation. The bloom size or amount is not affected. If you don't like that, try using Circlesoft's method.

Quote:
also if the bloom texture is added to the original HDR scene texture before tone-mapping pass, it will increase average luminance of the scene, influencing tone-mapping pass itself


Not true, if you use a luminance pass you'll be testing the original floating point scene (i.e. without bloom). The implemenation from that article is simplified so luminance is just a constant factor applied each frame. As a result, bloom doesn't affect anything.

Share this post


Link to post
Share on other sites
Thanks for the answer.

Quote:
Not true, if you use a luminance pass you'll be testing the original floating point scene (i.e. without bloom).


So I have HDR scene texture, I measure average luminance of it, then add bloom to the scene and then using average luminance of the scene I perform tone mapping of scene+bloom texture?

Quote:

If you don't like that...

It's not that I don't like that [smile] I.e. in FarCry, which performs bright pass on HDR scene texture (at least that's what I've figured out from this paper), you can notice that when you look at a hole in the wall (or a window) from a distance you just see bright blur. When you come closer your sight adapts to the light (average luminance increases) and you can see everything through the hole.
So it somehow has to be dependendent on the luminance (or maybe I just don't understand it). If I'd measure luminance of the scene only, I could pass the average luminance value to the brightpass filter (but I don't know how could I use it there [smile]).

Quote:

...try using Circlesoft's method.

You've probably noticed that I started "Circlesoft's method" topic. I still can't really understand how he does it. I mean after tone mapping you loose all HDR info, so how can he bloom only the inner part of the back side of the cube (the round thingy), while the frame around it is not affected by the bloom. They both have almost the same color as can be seen on the image with LDR bloom texture (his last post in that topic).
How does he do his bright pass? With HDR texture you can have very bright non-white object (i.e. street lights at night etc.) and blooming it will produce non-white blur. After doing tone mapping you loose information about light intensity. So how can you do bright pass after tone mapping, so you won't have just white pixels left?

Share this post


Link to post
Share on other sites
Quote:
So I have HDR scene texture, I measure average luminance of it, then add bloom to the scene and then using average luminance of the scene I perform tone mapping of scene+bloom texture?


Yes.

Quote:
It's not that I don't like that I.e. in FarCry, which performs bright pass on HDR scene texture (at least that's what I've figured out from this paper), you can notice that when you look at a hole in the wall (or a window) from a distance you just see bright blur. When you come closer your sight adapts to the light (average luminance increases) and you can see everything through the hole.
So it somehow has to be dependendent on the luminance (or maybe I just don't understand it). If I'd measure luminance of the scene only, I could pass the average luminance value to the brightpass filter (but I don't know how could I use it there ).


That's exactly what you have to do. The current luminance value is passed to the brightpass filter and applied. Here's a shader code sampler from DXSDK HDRLighting demo:


float4 BrightPassFilter
(
in float2 vScreenPosition : TEXCOORD0
) : COLOR
{
float4 vSample = tex2D( s0, vScreenPosition );
float fAdaptedLum = tex2D( s1, float2(0.5f, 0.5f) );

// Determine what the pixel's value will be after tone-mapping occurs
vSample.rgb *= g_fMiddleGray/(fAdaptedLum + 0.001f);

// Subtract out dark pixels
vSample.rgb -= BRIGHT_PASS_THRESHOLD;

// Clamp to 0
vSample = max(vSample, 0.0f);

// Map the resulting value into the 0 to 1 range. Higher values for
// BRIGHT_PASS_OFFSET will isolate lights from illuminated scene
// objects.
vSample.rgb /= (BRIGHT_PASS_OFFSET+vSample);

return vSample;
}








I'm not sure if you're using DirectX, but dissecting that demo is an excellent way to learn true HDR (it even implements glare effects).

Quote:
You've probably noticed that I started "Circlesoft's method" topic. I still can't really understand how he does it. I mean after tone mapping you loose all HDR info, so how can he bloom only the inner part of the back side of the cube (the round thingy), while the frame around it is not affected by the bloom. They both have almost the same color as can be seen on the image with LDR bloom texture (his last post in that topic).
How does he do his bright pass? With HDR texture you can have very bright non-white object (i.e. street lights at night etc.) and blooming it will produce non-white blur. After doing tone mapping you loose information about light intensity. So how can you do bright pass after tone mapping, so you won't have just white pixels left?


Well, according to him, he keeps the scene in a floating point texture all the way through until blooming:

Quote:
You want to be using HDR floating-point textures the whole way through. Start by rendering the geometry into an FP texture, then use FP textures for the bright pass, blooms, ect. This way, you use a true 64- or 128- bit pipeline, and you don't get that washed out look.


I really haven't studied his method much, so I'm not completely sure of the details. I would PM him about it if you have more questions, although you're really fine just using the standard technique.

Anyways, as I've already said, check out some working HDR demos and fiddle with some code. Good luck! [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement