Jump to content
  • Advertisement
Sign in to follow this  
mede

transparenz with light (blend out objects)

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

i'm looking for a good solution to blend out objects which are far away... for this i blend a object to alpha value 0 then i take it from the renderetree. but in the moment i start blending i have to disable lighting for this object and this gives a unlovely ;) crossover ... have anyone an idee how i could blend an object with light ? or is there an other possibility to blend out an object ? p.s. a solution should not be very complex because this is only for objects far away ... very thanks for all help mede

Share this post


Link to post
Share on other sites
Advertisement
jep but i only want to blend out some objects and not all ...

and blending with light is a feature i'm intressted in general, e.g. for rendering glass

Share this post


Link to post
Share on other sites
I don't see why blending + lightning don't work. Something like this:
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GL11.glColor4f(1f, 1f, 1f, transparency_parameter);

and when your object is further away, you change its transparency_parameter from 1f ---> 0f, when it becomes transparent.

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!