1 # Script demonstrating Global illumination effects using non-interactive
2 # path tracing rendering engine in 3d view
4 #Category: Visualization
7 pload MODELING VISUALIZATION
9 # setup 3D viewer content
10 vinit name=View1 w=512 h=512
16 vlight add positional head 0 pos 0.5 0.5 0.85
17 vlight change 0 sm 0.06
18 vlight change 0 int 60.0
27 vdisplay b_1 b_2 b_3 b_5 b_6
28 vsetlocation b_1 1 0 0
29 vsetlocation b_2 -1 0 0
30 vsetlocation b_3 0 1 0
31 vsetlocation b_5 0 0 1
32 vsetlocation b_6 0 0 -1
34 vsetmaterial b_1 plastic
35 vsetmaterial b_2 plastic
36 vsetmaterial b_3 plastic
37 vsetmaterial b_5 plastic
38 vsetmaterial b_6 plastic
39 vbsdf b_1 -kd 1 0.3 0.3 -ks 0
40 vbsdf b_2 -kd 0.3 0.5 1 -ks 0
48 # setup first inner sphere
51 vsetlocation s 0.21 0.3 0.2
53 vbsdf s -absorpcolor 0.8 0.8 1.0
54 vbsdf s -absorpcoeff 6
56 # setup first inner box
59 vsetlocation c 0.55 0.3 0.0
60 vlocrotate c 0 0 0 0 0 1 -30
61 vsetmaterial c plastic
62 vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
64 # setup second inner box
67 vsetlocation g 0.7 0.25 0.2
68 vlocrotate g 0 0 0 0 0 1 10
70 vbsdf g -absorpcolor 0.8 1.0 0.8
71 vbsdf g -absorpcoeff 6
73 # setup second inner sphere
76 vsetmaterial r plastic
77 vbsdf r -kd 0.5 0.9 0.3 -ks 0.0 -kr 0.3 -n
78 vbsdf r -fresnel Constant 1.0
79 vsetlocation r 0.5 0.65 0.1
81 puts "Trying path tracing mode..."
82 vrenderparams -ray -gi -rayDepth 8
84 puts "Make several path tracing iterations to refine the picture, please wait..."
86 puts "Done. To improve the image further, or after view manipulations, give command:"
87 puts "vfps \[nb_iteratons\]"