Has anyone tried to use the ColorWriteEnable renderstate for masking rendering, say, only to the Alpha component or something similar?
I have. And setting this renderstate to something different than the standard 0x0f mask doesn't seem to have any effect, i.e. all the four channels are overwritten regardless of the writemask.
To use this renderstate, one must of course check the Caps to see if the gfxcard supports masking and mine is supposed to do that.
So, I was wondering if anyone had tried this and succeeded/failed in their attempt. Is there some trick to make it work or may there be some bug in my driver?
I'm rendering with a radeon9800pro.
Problems: ColorWriteEnable in DirectX
Started by Hyde, Mar 05 2006 08:48 AM
10 replies to this topic
#1
Posted 05 March 2006 - 08:48 AM
0, 1/2, 2/3, 3/4, 4/5, ...
#2
Posted 05 March 2006 - 09:18 AM
This isn't an answer to your precise question, but in OpenGL the equivalent facility is glColorMask and I know it works properly on at least a Radeon 9600 card.
reedbeta.com - developer blog, OpenGL demos, and other projects
#3
Posted 05 March 2006 - 11:25 AM
Reedbeta: Then the caps shouldn't be lying, good to know.
The documentation is quite clear on this point, so I suspect a driver bug. I encountered trouble with this renderstate a year ago. Then I did some testing and found that I could use the mask so I could write to the R, G and B respectively but the Alphaonly option failed. I have updated my drivers since then, and was suprised to find out that now I could not get any write mask to work.. sigh.
Unless nobody has the same experience! Then surely I must examine my code again ;)
The documentation is quite clear on this point, so I suspect a driver bug. I encountered trouble with this renderstate a year ago. Then I did some testing and found that I could use the mask so I could write to the R, G and B respectively but the Alphaonly option failed. I have updated my drivers since then, and was suprised to find out that now I could not get any write mask to work.. sigh.
Unless nobody has the same experience! Then surely I must examine my code again ;)
0, 1/2, 2/3, 3/4, 4/5, ...
#4
Posted 05 March 2006 - 01:50 PM
Yeah I think you have some problem in your code as the Radeon9xxx series definitely supports that. `Some old cards such as TNT2 don't have support for it, but I think almost anything newer has.
#5
Posted 05 March 2006 - 03:27 PM
juhnu: Yes, but have you actually tried this?
I mean, surely, I can not be the only one trying to use this feature in dx with radeon?
Ok, luckily I am only trying to write the A-channel, leaving RGB as they are. Hence I can use the following config:
...
AlphaBlendEnable = true ;
SEPARATEALPHABLENDENABLE = true ;
SrcBlend = zero ;
DestBlend = one ;
SrcBlendAlpha = one ;
DestBlendAlpha = zero ;
..
Instead of my first attempt which should have the same effect:
...
COLORWRITEENABLE = ALPHA ;
...
So problem avoided for this time. But somewhat unsatisfactory, I think.
Still interested in hearing about your experiences with this renderstate, though.
I mean, surely, I can not be the only one trying to use this feature in dx with radeon?
Ok, luckily I am only trying to write the A-channel, leaving RGB as they are. Hence I can use the following config:
...
AlphaBlendEnable = true ;
SEPARATEALPHABLENDENABLE = true ;
SrcBlend = zero ;
DestBlend = one ;
SrcBlendAlpha = one ;
DestBlendAlpha = zero ;
..
Instead of my first attempt which should have the same effect:
...
COLORWRITEENABLE = ALPHA ;
...
So problem avoided for this time. But somewhat unsatisfactory, I think.
Still interested in hearing about your experiences with this renderstate, though.
0, 1/2, 2/3, 3/4, 4/5, ...
#6
Posted 05 March 2006 - 09:32 PM
I'm using colorwriteenable quite heavily in a vj-set i'm working on right now. the stuff is supposed to run off my laptop with a r9600 mobility, and it works like a charm. I don't use alpha in the rendertargets at all, though.
#7
Posted 06 March 2006 - 01:04 AM
Hyde said:
juhnu: Yes, but have you actually tried this?
Yeah we are taking extensive use of the color masking and haven't encountered any problems with the chipset you mentioned.
#8
Posted 06 March 2006 - 10:16 AM
Easiest way to find out if its a driver bug is to run using the reference rasteriser. If it works perfectly its a driver issue if it doesn't then the issue is with you.
#9
Posted 09 March 2006 - 08:39 PM
Goz: My code works perfectly with the REF device.
All: Thanks for sharing your experiences. I'll see if there is any newer driver available, but I am not optimistic. Afterwards, I'll give up. Thanks for input.
All: Thanks for sharing your experiences. I'll see if there is any newer driver available, but I am not optimistic. Afterwards, I'll give up. Thanks for input.
0, 1/2, 2/3, 3/4, 4/5, ...
#10
Posted 09 March 2006 - 09:03 PM
updated drivers, no change.
0, 1/2, 2/3, 3/4, 4/5, ...
#11
Posted 13 March 2006 - 04:25 AM
Maybe something wrong with your card. I don't think this is a driver version issue.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












