transparenz with light (blend out objects)
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
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
and blending with light is a feature i'm intressted in general, e.g. for rendering glass
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement