Archived

This topic is now archived and is closed to further replies.

Alpha values in pixel shaders?

This topic is 5671 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to make a pixel have an alpha value using pixel shaders? And if so, how could I do it? This is driving me nuts.. My friend told me it can be done, but I can''t find anything on the subject.

Share this post


Link to post
Share on other sites
Imagine drawing a rectangle over your scene with the following shader. The resulting rectangle should be 50% gray and 50% opaque.

ps.1.1
def c0, 0.5, 0.5, 0.5, 0.5
mov r0, c0

Do you have the alpha blending states set? (Does non-pixel shader alpha blending work properly?)



Share this post


Link to post
Share on other sites
No, I don't have any alpha blending states set. Do I haveto set them for pixel shaders? (sorry, I'm new to pixel shaders, and am kinda lost)

EDIT: I forgot to mention, I checked in NVSD, and the 4th value in r0 isn't changing.

[edited by - hello2k1 on June 2, 2002 8:08:03 PM]

Share this post


Link to post
Share on other sites