Unwanted blending

Started by
1 comment, last by JMab 9 years, 6 months ago

Hello all,

I'm having what I think is an odd problem. Here's what an example pixel is doing in the Output Merger stage:

Blending.jpg?dl=0

The final triangle strip outputs a color from the pixel shader of (0.27,0.30,0.43,1), which is what I want as the final color, however it is getting blended with the previous value to give a lighter shade.

I thought the blending in the Output Merger state was completely controlled by the blend state. This is how my blend state is set:

Blend%20state.jpg?dl=0

With BlendEnable and LogicOpEnable both FALSE, I thought that no blending would be performed. However I'm getting this unwanted blending. Any idea how to stop it?

Cheers,

John

Advertisement

What is your render target format?

If you take your pixel shader output and pow it by 2,2 you'll get approximately the result you see in the debugger.

Cheers!

[edit] probably the old value in the buffer doesn't have any effect to the final output - you can confirm this by clearing the render target before drawing the tri-strip.

I love this place! I occasionally come here with a problem I think is obscure and difficult and an expert like you kauna points out that the answer is simple and obvious!

My render target format is DXGI_FORMAT_R8G8B8A8_UNORM_SRGB. The rest of my engine renders in linear space and I have been trying to integrate the Nvidia OceanCS sample into my engine, without even thinking of transforming the gamma colors to linear. Thanks!

Voila!

Ocean.jpg?dl=0

Edit: I should add, I'm not quite finished though - the color is close, but not quite right (maybe need to do some other conversions to linear space earlier as well), there are some white triangle artifacts in the top-left hand side of the ocean and it needs to be integrated with my realtime sky component, but it's getting close!

This topic is closed to new replies.

Advertisement