Archived issue #0023191
Visualization - small objects displayed with visual artifacts
Description
Trivial interactive object displayed with serious visual artifacts without sanity reason. The reason is probably very rude value used for Z-fit.
Steps to reproduce
Original test case:
Localized:
pload VISUALIZATION MODELING restore w:/Attachment 1 (BREP) i explode i ttranslate i_1 0.005 0 0 vinit View1 vclear vsetdispmode 1 vdisplay i i_1 vfit
Localized:
pload VISUALIZATION MODELING restore w:/Attachment 1 (BREP) i explode i explode i_2 F compound i_2_1 i_2_4 i_2_5 i2 compound i_2_2 i_2_3 i3 ttranslate i_2 0.003 0 0 ttranslate i2 0.006 0 0 ttranslate i3 0.006 0 0 vinit View1 vclear vsetdispmode 1 vdisplay i_2 i2 i3 vsetcolor i3 RED vbottom vfit
Public activity
9 archived notes
Participants are labeled by their role within this record.
Original shapes have been lost - should be re-created.
The actual artifacts caused by rough Z fit range computation - should be checked on #0024001 branch.
The difference between compound / not compound is caused by back face culling mechanism which is turned on automatically for closed shapes. However mechanism is incomplete and works only when root shape has closed flag, see StdPrs_ShadedShape, ShadeFromShape():
thus this check fails when closed shapes are stored in compound, or if displayed Solid without closed flag (for example - command "box" produces Solid without Closed flag, which contains Shell with Closed flag).
The difference between compound / not compound is caused by back face culling mechanism which is turned on automatically for closed shapes. However mechanism is incomplete and works only when root shape has closed flag, see StdPrs_ShadedShape, ShadeFromShape():
if (!theDrawer->ShadingAspectGlobal())
{
Handle(Graphic3d_AspectFillArea3d) anAsp = theDrawer->ShadingAspect()->Aspect();
if (StdPrs_ToolShadedShape::IsClosed (theShape))
{
anAsp->SuppressBackFace();
}
else
{
anAsp->AllowBackFace();
}
thus this check fails when closed shapes are stored in compound, or if displayed Solid without closed flag (for example - command "box" produces Solid without Closed flag, which contains Shell with Closed flag).
Apart from z-fighting artifacts elimination (between back/front faces, noticeable on solid boundaries), back face culling affects performance as well.
Testing on Solid with 710784 triangles. Without culling:
with culling:
Testing on Solid with 710784 triangles. Without culling:
FPS: 14.781480904813739 CPU: 14.664094000000034 msec
with culling:
FPS: 24.5940756343402 CPU: 9.6720619999999258 msec
Behavior becomes worse on current patch for #0024001 issue.
Dear Commenter 1,
the original problem seems to be resolved by #0024413.
Please add localized test case to data base and switch to tested.
the original problem seems to be resolved by #0024413.
Please add localized test case to data base and switch to tested.
Branch [archived branch] has been created by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Participant.
[revision removed]
[revision removed]
Dear Commenter 1,
Test case bugs/vis(004)/bug23191 was pushed to new branch CR23191 in occt git-repository.
[revision removed]
Test case bugs/vis(004)/bug23191 was pushed to new branch CR23191 in occt git-repository.
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records
- #0024539 · related to · closedVisualization (new camera) - small objects displayed with visual artifacts
- #0024413 · related to · closedVisualization - get rid of projection shift from orthographic camera definition
- #0024521 · related to · closedVisualization - automatic back face culling is not turned on for Solids packed into compound