DiscussionsIssue archiveOCCT:Visualization

Archived issue #0023191

Visualization - small objects displayed with visual artifacts

Open CASCADEOCCT:Visualizationclosed9 public notes

Search issues

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:
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.

01Author
Original shapes have been lost - should be re-created.
02Author
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():
    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).
03Author
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:
FPS: 14.781480904813739
CPU: 14.664094000000034 msec

with culling:
FPS: 24.5940756343402
CPU: 9.6720619999999258 msec
04Author
Behavior becomes worse on current patch for #0024001 issue.
05Author
Dear Commenter 1,

the original problem seems to be resolved by #0024413.
Please add localized test case to data base and switch to tested.
06Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]
07Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]
08Commenter 8
Dear Commenter 1,

Test case bugs/vis(004)/bug23191 was pushed to new branch CR23191 in occt git-repository.
[revision removed]
09Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records