Sign in to follow this  

transparenz with light (blend out objects)

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

This topic is 4356 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this