Archived issue #0008568
Regression of transparency implementation as compared to OCC 3.1
Description
It is clear from the two sample images attached that the current transparency
implementation is much worse than in version 3.1.
This problem appeared as a result of solving BUC60918 by GG.
However, it is obvious that the situation is much better, if we roll back GG's
modifications in OpenGl_attri.c.
After all, there is still a problem when several transparent objects are
displayed (they are always blended according to display order, not according to
their Z order for the current view angle) - it is beyond the scope of this bug,
have much higher complexity and should be treated separately.
implementation is much worse than in version 3.1.
This problem appeared as a result of solving BUC60918 by GG.
However, it is obvious that the situation is much better, if we roll back GG's
modifications in OpenGl_attri.c.
After all, there is still a problem when several transparent objects are
displayed (they are always blended according to display order, not according to
their Z order for the current view angle) - it is beyond the scope of this bug,
have much higher complexity and should be treated separately.
Additional information
Documentation remark, added by Author 2005-04-19 14:41:20:
Changes:
Regression of transparency implementation as compared to OCC3.x was fixed.
However, transparency problem in general partially remains even for a single
transparent object. Undesirable visual effects can be seen resulting
from lighting calculations performed by OpenGL: calculated color of two
triangles A and B (one lying on a part of shape more distant from the eye,
another on a closer part, both oriented differently with repsect to light
direction) is different.
Therefore, result of blending "backround color -> 0.9 * A color -> 0.9 * B
color" is different from blending "backround color -> 0.9 * B color -> 0.9 * A
color". In other words, the resulting image still depends on order of triangles
in object's triangulation.
In order to avoid problems of different nature - wrong blending of opaque and
transparent objects (like an opaque object not
showing through a transparent one due to the latter being displayed first),
application developers should take care of displaying objects in proper order.
The easiest way to do this is demonstrated in AIS_Shape::Compute() method:
highest display priority (10) is forced for transparent objects, so that they
are drawn the last.
Changes:
Regression of transparency implementation as compared to OCC3.x was fixed.
However, transparency problem in general partially remains even for a single
transparent object. Undesirable visual effects can be seen resulting
from lighting calculations performed by OpenGL: calculated color of two
triangles A and B (one lying on a part of shape more distant from the eye,
another on a closer part, both oriented differently with repsect to light
direction) is different.
Therefore, result of blending "backround color -> 0.9 * A color -> 0.9 * B
color" is different from blending "backround color -> 0.9 * B color -> 0.9 * A
color". In other words, the resulting image still depends on order of triangles
in object's triangulation.
In order to avoid problems of different nature - wrong blending of opaque and
transparent objects (like an opaque object not
showing through a transparent one due to the latter being displayed first),
application developers should take care of displaying objects in proper order.
The easiest way to do this is demonstrated in AIS_Shape::Compute() method:
highest display priority (10) is forced for transparent objects, so that they
are drawn the last.
Public activity
1 archived note
Participants are labeled by their role within this record.
*** Bug 2744 has been marked as a duplicate of this bug. ***
Related records