0e3025bc |
1 | puts "=============" |
2 | puts "0030434: Visualization, TKV3d - add 'NoUpdate' state of frustum culling optimization" |
3 | puts "=============" |
4 | |
5 | pload VISUALIZATION |
6 | vclear |
7 | vinit View1 |
8 | |
9 | set THE_NB_POINTS 10 |
10 | puts "Creating [expr $THE_NB_POINTS * $THE_NB_POINTS * $THE_NB_POINTS] points..." |
11 | for {set i 0} {$i < $THE_NB_POINTS} {incr i} { |
12 | for {set j 0} {$j < $THE_NB_POINTS} {incr j} { |
13 | for {set k 0} {$k < $THE_NB_POINTS} {incr k} { |
14 | vpoint p$i$j$k 3.*$i 3.*$j 3.*$k |
15 | } |
16 | } |
17 | } |
18 | |
19 | vcamera -ortho |
20 | vfront |
21 | vfit |
22 | vzoom 2 |
23 | vrenderparams -frustumculling on |
24 | vrenderparams -frustumculling noupdate |
25 | vfit |
26 | if { [vreadpixel 92 92 rgb name] == "YELLOW" } { puts "Error: point should be clipped earlier" } |
27 | vdump $::imagedir/${::casename}_ortho_culled.png |
28 | vrenderparams -frustumculling off |
29 | if { [vreadpixel 92 92 rgb name] != "YELLOW" } { puts "Error: point should NOT be clipped" } |
30 | vdump $::imagedir/${::casename}_ortho_all.png |
31 | |
32 | vcamera -persp |
33 | vaxo |
34 | vfit |
35 | vzoom 3 |
36 | vrenderparams -frustumculling on |
37 | vrenderparams -frustumculling noupdate |
38 | vfit |
39 | if { [vreadpixel 114 92 rgb name] == "YELLOW" } { puts "Error: point should be clipped earlier" } |
40 | vdump $::imagedir/${::casename}_persp_culled.png |
41 | vrenderparams -frustumculling off |
42 | if { [vreadpixel 114 92 rgb name] != "YELLOW" } { puts "Error: point should NOT be clipped" } |
43 | vdump $::imagedir/${::casename}_persp_all.png |