1 # Script demonstrating Global illumination effects using non-interactive
2 # path tracing rendering engine in 3d view
4 #Category: Visualization
5 #Title: Path tracing - Cube
7 pload MODELING VISUALIZATION
9 # setup 3D viewer content
11 vinit name=View1 w=512 h=512
16 vlight -add positional -head 0 -pos 0.5 0.5 0.85 -sm 0.06 -int 30.0
25 vdisplay -noupdate b_1 b_2 b_3 b_5 b_6
26 vlocation -noupdate b_1 -setLocation 1 0 0
27 vlocation -noupdate b_2 -setLocation -1 0 0
28 vlocation -noupdate b_3 -setLocation 0 1 0
29 vlocation -noupdate b_5 -setLocation 0 0 1
30 vlocation -noupdate b_6 -setLocation 0 0 -1
32 vsetmaterial -noupdate b_1 plastic
33 vsetmaterial -noupdate b_2 plastic
34 vsetmaterial -noupdate b_3 plastic
35 vsetmaterial -noupdate b_5 plastic
36 vsetmaterial -noupdate b_6 plastic
37 vbsdf b_1 -kd 1 0.3 0.3 -ks 0
38 vbsdf b_2 -kd 0.3 0.5 1 -ks 0
46 # setup first inner sphere
49 vlocation -noupdate s -setLocation 0.21 0.3 0.2
50 vsetmaterial -noupdate s glass
51 vbsdf s -absorpColor 0.8 0.8 1.0
52 vbsdf s -absorpCoeff 6
54 # setup first inner box
57 vlocation -noupdate c -setLocation 0.55 0.3 0.0
58 vlocation -noupdate c -rotate 0 0 0 0 0 1 -30
59 vsetmaterial -noupdate c plastic
60 vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
62 # setup second inner box
65 vlocation -noupdate g -setLocation 0.7 0.25 0.2
66 vlocation -noupdate g -rotate 0 0 0 0 0 1 10
67 vsetmaterial -noupdate g glass
68 vbsdf g -absorpColor 0.8 1.0 0.8
69 vbsdf g -absorpCoeff 6
71 # setup second inner sphere
74 vsetmaterial -noupdate r plastic
75 vbsdf r -kd 0.5 0.9 0.3 -ks 0.3 -baseRoughness 0.0 -n
76 vbsdf r -baseFresnel Constant 1.0
77 vlocation r -setLocation 0.5 0.65 0.1
79 puts "Trying path tracing mode..."
80 vrenderparams -ray -gi -rayDepth 8
82 puts "Make several path tracing iterations to refine the picture, please wait..."
84 puts "Done. To improve the image further, or after view manipulations, give command:"
85 puts "vfps \[nb_iteratons\] or vrepaint -continuous"