DirectX equivalent of glColorMask
I was wondering if anyone knew the DirectX equivalent of OpenGL's glColorMask. I'm basically trying to set up an anaglyph stereo scene that isn't depandant on the drivers for setting up the stereo. I'm trying to draw the red component from one viewpoint and all others from a different viewpoint.
For OpenGL, I've done something similar rendering the left with
glColorMask(true, false, false, false);
then setting the right to
glColorMask(false, true, true, true);
I'm also using DirectX 8.1. Thanks in advance for any info.
You could adjust the material for that, by zeroeing out the appropriate components. That is if you do not use the material for something else. Also you can control the gamma ramp (hardware dependent) and filter out the corresponding colors.
Greetz,
Illco
Greetz,
Illco
Wampus,
You're looking for the D3DRS_COLORWRITEENABLE state. It can be used as follows
pD3DDevice->SetRenderState( D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_RED );
This would allow ALL color channels of the backbuffer to be written to. If you want to allow ONLY Green and Blue (Alpha and Red unmodified ) use
pD3DDevice->SetRenderState( D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_GREEN );
You're looking for the D3DRS_COLORWRITEENABLE state. It can be used as follows
pD3DDevice->SetRenderState( D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_RED );
This would allow ALL color channels of the backbuffer to be written to. If you want to allow ONLY Green and Blue (Alpha and Red unmodified ) use
pD3DDevice->SetRenderState( D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_GREEN );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement