Sign in to follow this  

[Resolved] Inconsistent output from pixel shaders while porting DX9 to DX10

Recommended Posts

Hi, I've been porting my renderer from DX9 to DX10 and have run across some problems in my post effects system. My HDR system uses a 128 bit (I know I should migrate to the new dedicated formats, but later), render target for all scene rendering. At the end of the pipeline I tone map the 128 bit (A32G32R32B32) image to A8R8G8B8_UNORM using a pretty standard pixel shader: float4 color = tex2D(MeshTextureSampler, IN.Texture0); OUT.RGBColor.rgba = pow( 1.0f - exp( exposure * color ), gamma); The problem is that the expression (1.0f - exp (exposure * color)) just results in black pixels in Directx10. The same code works perfectly under my DX9 profile. There are also a few other post effects where my shader yields 0 as the result of the render that I'm kinda concerned about. Is there something that I have not read that I should be aware of? Any one know what I'm missing, because I'm all out of ideas... Thanks... [Edited by - sensate on May 16, 2008 3:16:11 PM]

Share this post

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

It turned out to be something a little more bizarre. (And shows that exp under hlsl dx9 was perhaps correcting the output value)

By changing the calculation to

1.0f - exp (-exposure * color)

I get the correct result on both dx10 and dx9.

So, Why was the expression working on dx9 when it was clearly wrong?

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