1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0027925: Visualization - implement order-independent transparency algorithm within rasterization rendering

Weighted, Blended Order-Independent Transparency algorithm has been added rasterization pipeline.
In contrast to classical blending transparency it makes transparent objects look independent
from point of view. It also gives better depth occlusion when being used together with a weight factor
based on value of a GL depth buffer. The feature supports desktop OpenGL, OpenGL ES 3.0, ANGLE
and can be used together with MSAA on desktop GL.

To be used it require availability of:
1) Shaders pipeline.
2) Floating point color format for framebuffer (GL_ARB_color_buffer_float).
3) Multiple render targets (GL_ARB_draw_buffers).

Patch does not modify API and does not require application porting.
It adds new rendering options to Graphic3d_RenderingParams structure:
a) Transparency method from enumeration.
b) Scalar factor [0-1] controlling influence of a fragment's depth to its visibility.

Patch also simplifies processing of transparent objects for standard method:
rendering priority of transparent graphical structures is managed automatically,
therefore there is no need to care about it at application's side.
This commit is contained in:
apl
2017-04-25 15:10:15 +03:00
committed by bugmaster
parent 9151562167
commit a1073ae267
41 changed files with 1947 additions and 299 deletions

View File

@@ -981,7 +981,6 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
aPrs->SetDisplayPriority (10); // force highest priority for translucent objects
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -1037,7 +1036,6 @@ void AIS_Shape::UnsetTransparency()
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
}
}
aPrs->ResetDisplayPriority();
}
myRecomputeEveryPrs = Standard_False; // no mode to recalculate :only viewer update

View File

@@ -105,11 +105,6 @@ void AIS_Triangulation::updatePresentation()
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
if (IsTransparent())
{
aPrs->SetDisplayPriority (10); // force highest priority for translucent objects
}
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
@@ -118,11 +113,6 @@ void AIS_Triangulation::updatePresentation()
aGroup->SetGroupPrimitivesAspect (anAreaAsp);
}
}
if (!IsTransparent())
{
aPrs->ResetDisplayPriority();
}
}
myRecomputeEveryPrs = Standard_False; // no mode to recalculate - only viewer update