File: bug24785

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (51 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This test case handles a specific task:
# to draw 2d objects in same scene with 3d objects while 
# 2d objects need to be drawn in specific order on 3d plane and
# overlap correctly with 3d objects.

pload ALL
vinit
# 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 b3 -0.25 -0.25 0 1 1 0.01
vdisplay b1
vdisplay b2
vdisplay b3
vsetmaterial b2 silver
vsetmaterial b3 copper

psphere s 0.3
vdisplay s

# Create new z-layer for 3d objects
vzlayer add
vobjzlayer set s 1 

vsetdispmode 1

# Disable OpenGl depth test for layer 0 (to eliminate flickering)
# But depth write is still enabled
vzlayer disable depthtest 0

# Disable depth buffer clearing for layer 1 (we want correct overlapping with 3d objects)
vzlayer disable depthclear 1

# List currently enabled settings of each layer
vzlayer settings 0
vzlayer settings 1

# "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 

# To handle this situation, depth offset setting was introduced.
# It implemented with glPolygonOffset calls per layer.
vzlayer enable positiveoffset 1

vfit