Trouble rendering to SurfaceFormat.Single

Started by
1 comment, last by gchewood 11 years ago

This problem has been bugging me all day and I sense there's a really simple solution.

When trying to render my game's depth map I get the following error:

XNA Framework HiDef profile does not support alpha blending or ColorWriteChannels when using rendertarget format Single.

I've tried setting BlendState to Opaque and even setting ColorWriteChannels to None. Doesn't fix it.

This is all in my game which is based on the game state manager sample for xna: http://xbox.create.msdn.com/en-US/education/catalog/sample/game_state_management

If I run the exact same code in a completely blank project with the exact same model, it works just fine! So I assume the game state manager is changing some settings that are causing it to fail? What else is there that could be causing this? It's driving me insane.

Please help!!

Thanks

Advertisement

Well, I think you should leave ColorWriteChannels as the default.

You're sure you're using BlendState.Opaque for every single draw call you make when that render target is bound?

And you're not using any custom shaders that set alpha-blending in the shader file?

Ugh, false alarm. When I was setting ColorWriteChannels to none, that was completely resetting the blendstate by the looks of things. You're right, removing that line solved the problem. Thanks for the advice.

Can't believe that took me so long :-| One of those days!

This topic is closed to new replies.

Advertisement