Jump to content
  • Advertisement

Archived

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

hello2k1

Alpha values in pixel shaders?

This topic is 5866 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
Advertisement
Do you mean to set the alpha channel or are you asking about destination alpha?

dealing with alpha is just r0.a, etc.

destination alpha needs to be set up elsewhere, but once it''s set, the pixel shader should work.

Share this post


Link to post
Share on other sites
Do you think you could give me an example as to how to make a pixel be 50% opaque? I have tried playing with r0.a, but it doesnt seem to be able to be changed.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!