mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0032274: Tests - unstable snapshots from test case v3d/bugs/bug24785
Test case has been adjusted to reproduce scenario it was supposed to check.
This commit is contained in:
parent
c57bf5636c
commit
95bdefb201
@ -5598,7 +5598,7 @@ static int VZLayer (Draw_Interpretor& theDI,
|
||||
Graphic3d_ZLayerSettings aSettings = aViewer->ZLayerSettings (aLayeriter.Value());
|
||||
printZLayerInfo (theDI, aSettings);
|
||||
}
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Integer anArgIter = 1;
|
||||
|
@ -6,45 +6,52 @@ vinit View1
|
||||
# Thin boxes represent overlapping 2d objects in same plane
|
||||
# Normally such configuration would cause z-fighting noise (flickering)
|
||||
box b1 -0.75 -0.75 0 1 1 0.01
|
||||
box b2 -0.5 -0.5 0 1 1 0.01
|
||||
box b2 -0.50 -0.50 0 1 1 0.01
|
||||
box b3 -0.25 -0.25 0 1 1 0.01
|
||||
vdisplay b1
|
||||
vdisplay b2
|
||||
vdisplay b3
|
||||
vsetmaterial b2 silver
|
||||
vsetmaterial b3 copper
|
||||
vdisplay b1 b2 b3 -dispMode 1
|
||||
vaspects b1 -material brass
|
||||
vaspects b2 -material silver
|
||||
vaspects b3 -material copper
|
||||
# Set object polygon mode Aspect_POM_None to inherit Z-Layer settings,
|
||||
# as default object polygon offset is "Aspect_POM_Fill 1 1" (overrides Z-layer settings)
|
||||
vpolygonoffset b1 8 0 0
|
||||
vpolygonoffset b2 8 0 0
|
||||
vpolygonoffset b3 8 0 0
|
||||
|
||||
psphere s 0.3
|
||||
vdisplay s
|
||||
vdisplay s -dispMode 1
|
||||
vaspects s -material brass
|
||||
vpolygonoffset s 8 0 0
|
||||
|
||||
# Create new z-layer for 3d objects
|
||||
vzlayer add
|
||||
vobjzlayer set s 1
|
||||
catch { vzlayer -delete 1 }
|
||||
set aLayerId [vzlayer add]
|
||||
vdisplay s -layer $aLayerId
|
||||
|
||||
vsetdispmode 1
|
||||
|
||||
# Disable OpenGl depth test for layer 0 (to eliminate flickering)
|
||||
# Disable OpenGL depth test for layer 0 (to eliminate flickering)
|
||||
# But depth write is still enabled
|
||||
vzlayer disable depthtest 0
|
||||
vzlayer DEFAULT -disable depthTest
|
||||
|
||||
# Disable depth buffer clearing for layer 1 (we want correct overlapping with 3d objects)
|
||||
vzlayer disable depthclear 1
|
||||
vzlayer $aLayerId -disable depthClear
|
||||
|
||||
# List currently enabled settings of each layer
|
||||
vzlayer settings 0
|
||||
vzlayer settings 1
|
||||
vzlayer DEFAULT -settings
|
||||
vzlayer $aLayerId -settings
|
||||
|
||||
# "3d" box with one of its faces on same plane with "2d" objects
|
||||
# Normally this also would cause flickering because new box is
|
||||
# supposed to be in layer 1 as "3d" structure, thus depth test between
|
||||
# new box and "2d" objects will be enabled.
|
||||
box b 0 0 0.01 0.5 0.5 -0.5
|
||||
vdisplay b
|
||||
vobjzlayer set b 1
|
||||
vdisplay b -dispMode 1 -layer $aLayerId
|
||||
vaspects b -material brass
|
||||
vpolygonoffset b 8 0 0
|
||||
|
||||
# To handle this situation, depth offset setting was introduced.
|
||||
# It implemented with glPolygonOffset calls per layer.
|
||||
vzlayer enable positiveoffset 1
|
||||
# Set polygon offset 2 (greater than default value 1 to see the difference).
|
||||
vzlayer 1 -enable depthoffset 2 1
|
||||
|
||||
vfit
|
||||
vdump $imagedir/${casename}.png
|
||||
|
Loading…
x
Reference in New Issue
Block a user