Jump to content
  • Advertisement
Sign in to follow this  

Making ambient color transparent

This topic is 3902 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

Hello! This is probably an alpha blending related question: I have a sphere lighted on a side by a distant light. This sphere has an ambient color (black, transparent) a diffuse color (gray, opaque) and a texture (opaque), and stands in a lightblue background. I'd like to make the ambient color appear transparent. Setting it to background color doesn't give the right result. Here is what I do: Stage 0: - set texture stage render state - set an alpha render state for the stage giving: > alpha blend enabled > alpha test enabled, default test function (greater, if I'm not wrong) > alpha source function: 1-SRCalpha > alpha dest function: 1 This gives some nice results as shown in the following picture: but, as you can see, the texture is saturated to white due to the alpha dest function, I suppose. QUESTION: how do I make another overlay (render pass or texture stage) to replace the opaque white with the color texture and leaving transparency from the previous stage? Thanks a lot for any help you can give.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!