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'm using direct2d and direct3d together and having an issue with gamma correction. My direct3d backbuffer is using an SRGB format and when I render images from direct2d onto the direct3d surface, they appear washed out. I can't seem to figure out how to enable SRGB on the direct2d end. Does anyone know who to do this?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I'm not very familiar with Direct2D, so I don't know if images there can be marked as being in sRGB format; but a possible workaround is to maintain two render target views of your back buffer, one in sRGB format and the other in regular (linear) RGB. When rendering Direct2D stuff where you just want to copy the pixels straight over, you'd use the linear one; when rendering 3D stuff you'd use the sRGB one. Note that this doesn't mean having two separate buffers, just two render target views of the same buffer. There could be a performance cost switching between them, though, so if possible you'd want to ensure you only switched once per frame.

share|improve this answer
    
Ah, great idea. That worked perfectly –  Telanor Oct 25 '12 at 5:08
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.