Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was going to draw my shadow map into one channel of a 16 bit texture and then draw a different shadow map into another channel of the same texture.

I realized that this might not be possible to do efficiently since my targetted hardware (Xbox) does not support blending R16G16 formats. (Although the HDRBlendable might make it possible if I need a blendable format to do this.)

Is it possible to mask one channel of a R16G16 texture on the Xbox? How do I do that?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

No you can't mask a R16G16 channel in XNA.

You can do it with a blendable format though, in my case, to use floating point the best you can do is to use HDRBlendable (R10G10B10A2 on the Xbox), and set ColorWriteChannels in the blendstate used appropriately, e.g.:

    myBlendState = new BlendState() 
    { 
        AlphaSourceBlend = Blend.One, 
        ColorSourceBlend = Blend.One, 
        AlphaDestinationBlend = Blend.Zero, 
        ColorDestinationBlend = Blend.Zero, 
        ColorWriteChannels = ColorWriteChannels.Red 
    }; 
share|improve this answer
    
R10G10B10A10 = 40bpp? oO Isn't it more like R10G10B10A2? –  Jonathan Connell Jun 8 '11 at 10:48
    
Yes, it is. Thanks :) –  Olhovsky Jun 8 '11 at 12:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.