Sign in to follow this  
Defrag

HDR... very washed out (NVIDIA HDR Sample)

Recommended Posts

I just added HDR to my app and... it's not at all how I want it to look. I'm using the code from the NVIDIA SDK 2 x 16FP MRTs sample and my scene is very washed out. The effect itself is working, but everything looks horrid. I tried turning down the exposure but it doesn't solve the contrast issue. The skybox is totally pixelated, whereas the rest of the scene is really washed out. I'm not using cubemaps or anything like that (the NVIDIA sample uses HDR cubemaps to light the scene whereas I'm using traditional lighting -- is this a problem? -- I figured that it should work either way). Does anyone have any suggestions on how to heuristically tweak this code? I don't have weeks to tinker with this as it's not the focus of my program, but I thought it'd be nice to add HDR for a bit of eye-candy. I already tried using the HDR code from the NVIDIA deferred shading application as an alternative and it looked pretty bland, too. It wasn't washed out in the way my current version is, but it still was very dull plus it ran exceedingly slowly. This new version runs quite quickly on my 6800GT (knocks maybe 20-30% off the framerate which is acceptable). Here's a few screen grabs to show you what I mean by washed out. LDR -- old shot. Ambient & Directional Light -- notice the contrast is nice. HDR -- Ambient, Directional & a couple of point lights -- notice the horrid contrast. Also, I tried to implement the 2xF16 method (as in 2 x 16R16GF instead of 1 x A16R16G16B16F) but I had some strange rendering errors. Every time I tried to blend new lights into the RT, it was simply replace the existing colour values instead of doing additive blending. I checked all of the device states etc. via NVPerfHUD and alpha blending was enabled with src & dest as One; everything looked fine and yet the output was mangled. I replaced the 2 x FP16 version with the single texture code and the blending works fine. I'd rather use the 2 x FP16 version though, as it will perform better. Anyone come across any similar problems to the one I describe? Finally, occasionally I'll start up my application and nothing will appear. It'll just be a white screen. It'll do this for a couple of runs then start working again. I have no idea why it's happening and I can't seem to recreate it. It only happens with HDR enabled but I haven't managed to recreate it when running pix/NVPerfHUD. Any thoughts on these issues is appreciated.

Share this post


Link to post
Share on other sites
Here's the code for it.

//#############################################################################
//
// TONE MAPPING
//
//#############################################################################
VS_OutputVTF VS_toneMapping(in float4 position: POSITION)
{
VS_OutputVTF OUT;

OUT = (VS_OutputVTF)0;

OUT.Tex.z = Exposure / max(0.001f, tex2Dlod(SamplerTexC, float4(0.5f, 0.5f, 0.0f, 0.0f)).x);

OUT.Pos = float4(position.x, position.y, 0.5f, 1.0f);
OUT.Tex.xy = position.zw;

return OUT;
}

float4 PS_toneMapping(in float3 Tex: TEXCOORD0) : COLOR
{
// sum original and blurred image
half3 c = (1.0f - blurBlendFactor) * tex2D(SamplerA, Tex.xy).rgb + blurBlendFactor * tex2D(SamplerScaledTexA, Tex.xy).rgb;

half3 L = c * Tex.z;

// exposure
c = L / (1 + L);

// vignette effect (makes brightness drop off with distance from center)
vignette(c, Tex.xy);

return float4(c, 1.0);
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this