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

Started by
1 comment, last by sensate 15 years, 11 months ago
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]
Advertisement
Check your alpha values carefully on that step.

Niko Suni

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.
Strange...

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

This topic is closed to new replies.

Advertisement