0026139: AIS_InteractiveContext::Display performance regression
[occt.git] / tests / bugs / vis / bug24785
CommitLineData
c5751993 1# This test case handles a specific task:
2# to draw 2d objects in same scene with 3d objects while
3# 2d objects need to be drawn in specific order on 3d plane and
4# overlap correctly with 3d objects.
5
6pload ALL
7vinit
8# Thin boxes represent overlapping 2d objects in same plane
9# Normally such configuration would cause z-fighting noise (flickering)
10box b1 -0.75 -0.75 0 1 1 0.01
11box b2 -0.5 -0.5 0 1 1 0.01
12box b3 -0.25 -0.25 0 1 1 0.01
13vdisplay b1
14vdisplay b2
15vdisplay b3
16vsetmaterial b2 silver
17vsetmaterial b3 copper
18
19psphere s 0.3
20vdisplay s
21
22# Create new z-layer for 3d objects
23vzlayer add
24vobjzlayer set s 1
25
26vsetdispmode 1
27
28# Disable OpenGl depth test for layer 0 (to eliminate flickering)
29# But depth write is still enabled
30vzlayer disable depthtest 0
31
32# Disable depth buffer clearing for layer 1 (we want correct overlapping with 3d objects)
33vzlayer disable depthclear 1
34
35# List currently enabled settings of each layer
36vzlayer settings 0
37vzlayer settings 1
38
39# "3d" box with one of its faces on same plane with "2d" objects
40# Normally this also would cause flickering because new box is
41# supposed to be in layer 1 as "3d" structure, thus depth test between
42# new box and "2d" objects will be enabled.
43box b 0 0 0.01 0.5 0.5 -0.5
44vdisplay b
45vobjzlayer set b 1
46
47# To handle this situation, depth offset setting was introduced.
48# It implemented with glPolygonOffset calls per layer.
49vzlayer enable positiveoffset 1
50
51vfit