Sign in to follow this  
gchewood

Trouble rendering to SurfaceFormat.Single

Recommended Posts

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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!

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