0028599: Replacement of old Boolean operations with new ones in BRepProj_Projection...
[occt.git] / samples / tcl / pathtrace_cube.tcl
CommitLineData
d8d34245 1# Script demonstrating Global illumination effects using non-interactive
2# path tracing rendering engine in 3d view
8c820969 3
d8d34245 4#Category: Visualization
6e728f3b 5#Title: Path tracing - Cube
d8d34245 6
7pload MODELING VISUALIZATION
8c820969 8
9# setup 3D viewer content
6e728f3b 10vclear
8c820969 11vinit name=View1 w=512 h=512
12vglinfo
13
d8d34245 14# setup light sources
15vlight del 0
16vlight del 1
17vlight add positional head 0 pos 0.5 0.5 0.85
18vlight change 0 sm 0.06
3a9b5dc8 19vlight change 0 int 30.0
d8d34245 20
8c820969 21vvbo 0
22vsetdispmode 1
23vcamera -persp
24
d8d34245 25# setup outer box
8c820969 26box b 1 1 1
27explode b FACE
6e728f3b 28vdisplay -noupdate b_1 b_2 b_3 b_5 b_6
29vlocation -noupdate b_1 -setLocation 1 0 0
30vlocation -noupdate b_2 -setLocation -1 0 0
31vlocation -noupdate b_3 -setLocation 0 1 0
32vlocation -noupdate b_5 -setLocation 0 0 1
33vlocation -noupdate b_6 -setLocation 0 0 -1
8c820969 34
6e728f3b 35vsetmaterial -noupdate b_1 plastic
36vsetmaterial -noupdate b_2 plastic
37vsetmaterial -noupdate b_3 plastic
38vsetmaterial -noupdate b_5 plastic
39vsetmaterial -noupdate b_6 plastic
d8d34245 40vbsdf b_1 -kd 1 0.3 0.3 -ks 0
41vbsdf b_2 -kd 0.3 0.5 1 -ks 0
8c820969 42vbsdf b_3 -kd 1 -ks 0
43vbsdf b_5 -kd 1 -ks 0
44vbsdf b_6 -kd 1 -ks 0
45
d8d34245 46vfront
47vfit
8c820969 48
d8d34245 49# setup first inner sphere
8c820969 50psphere s 0.2
6e728f3b 51vdisplay -noupdate s
52vlocation -noupdate s -setLocation 0.21 0.3 0.2
53vsetmaterial -noupdate s glass
05aa616d 54vbsdf s -absorpColor 0.8 0.8 1.0
55vbsdf s -absorpCoeff 6
8c820969 56
d8d34245 57# setup first inner box
8c820969 58box c 0.3 0.3 0.2
6e728f3b 59vdisplay -noupdate c
60vlocation -noupdate c -setLocation 0.55 0.3 0.0
61vlocation -noupdate c -rotate 0 0 0 0 0 1 -30
62vsetmaterial -noupdate c plastic
8c820969 63vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
64
d8d34245 65# setup second inner box
8c820969 66box g 0.15 0.15 0.3
6e728f3b 67vdisplay -noupdate g
68vlocation -noupdate g -setLocation 0.7 0.25 0.2
69vlocation -noupdate g -rotate 0 0 0 0 0 1 10
70vsetmaterial -noupdate g glass
05aa616d 71vbsdf g -absorpColor 0.8 1.0 0.8
72vbsdf g -absorpCoeff 6
8c820969 73
d8d34245 74# setup second inner sphere
8c820969 75psphere r 0.1
6e728f3b 76vdisplay -noupdate r
77vsetmaterial -noupdate r plastic
05aa616d 78vbsdf r -kd 0.5 0.9 0.3 -ks 0.3 -baseRoughness 0.0 -n
79vbsdf r -baseFresnel Constant 1.0
6e728f3b 80vlocation r -setLocation 0.5 0.65 0.1
8c820969 81
d8d34245 82puts "Trying path tracing mode..."
8c820969 83vrenderparams -ray -gi -rayDepth 8
d8d34245 84
85puts "Make several path tracing iterations to refine the picture, please wait..."
86vfps 100
87puts "Done. To improve the image further, or after view manipulations, give command:"
88puts "vfps \[nb_iteratons\]"