1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0027250: Samples - define proper file header for pathtrace.tcl

Sample "Path tracing" is corrected to be shown in Visualization section, and to explain what it does during execution
This commit is contained in:
kgv 2016-03-11 11:33:08 +03:00 committed by abv
parent 60a6678eee
commit d8d342451d

View File

@ -1,51 +1,51 @@
#########################################################################
# 26437: Visualization - Improve path tracing rendering engine
#########################################################################
# Script demonstrating Global illumination effects using non-interactive
# path tracing rendering engine in 3d view
pload ALL
#Category: Visualization
#Title: Path tracing
pload MODELING VISUALIZATION
# setup 3D viewer content
vinit name=View1 w=512 h=512
vglinfo
vvbo 0
vsetdispmode 1
vcamera -persp
box b 1 1 1
explode b FACE
vdisplay b_1 b_2 b_3 b_5 b_6
vfront
vfit
vsetmaterial b_1 plastic
vsetmaterial b_2 plastic
vsetmaterial b_3 plastic
vsetmaterial b_5 plastic
vsetmaterial b_6 plastic
vbsdf b_1 -kd 1 -ks 0
vbsdf b_2 -kd 1 -ks 0
vbsdf b_3 -kd 1 -ks 0
vbsdf b_5 -kd 1 -ks 0
vbsdf b_6 -kd 1 -ks 0
vbsdf b_2 -kd 0.3 0.5 1
vbsdf b_1 -kd 1 0.3 0.3
vsetlocation b_1 1 0 0
vsetlocation b_2 -1 0 0
vsetlocation b_5 0 0 1
vsetlocation b_6 0 0 -1
vsetlocation b_3 0 1 0
# setup light sources
vlight del 0
vlight del 1
vlight add positional head 0 pos 0.5 0.5 0.85
vlight change 0 sm 0.06
vlight change 0 int 60.0
vvbo 0
vsetdispmode 1
vcamera -persp
# setup outer box
box b 1 1 1
explode b FACE
vdisplay b_1 b_2 b_3 b_5 b_6
vsetlocation b_1 1 0 0
vsetlocation b_2 -1 0 0
vsetlocation b_3 0 1 0
vsetlocation b_5 0 0 1
vsetlocation b_6 0 0 -1
vsetmaterial b_1 plastic
vsetmaterial b_2 plastic
vsetmaterial b_3 plastic
vsetmaterial b_5 plastic
vsetmaterial b_6 plastic
vbsdf b_1 -kd 1 0.3 0.3 -ks 0
vbsdf b_2 -kd 0.3 0.5 1 -ks 0
vbsdf b_3 -kd 1 -ks 0
vbsdf b_5 -kd 1 -ks 0
vbsdf b_6 -kd 1 -ks 0
vfront
vfit
# setup first inner sphere
psphere s 0.2
vdisplay s
vsetlocation s 0.21 0.3 0.2
@ -53,6 +53,7 @@ vsetmaterial s glass
vbsdf s -absorpcolor 0.8 0.8 1.0
vbsdf s -absorpcoeff 6
# setup first inner box
box c 0.3 0.3 0.2
vdisplay c
vsetlocation c 0.55 0.3 0.0
@ -60,6 +61,7 @@ vlocrotate c 0 0 0 0 0 1 -30
vsetmaterial c plastic
vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
# setup second inner box
box g 0.15 0.15 0.3
vdisplay g
vsetlocation g 0.7 0.25 0.2
@ -68,6 +70,7 @@ vsetmaterial g glass
vbsdf g -absorpcolor 0.8 1.0 0.8
vbsdf g -absorpcoeff 6
# setup second inner sphere
psphere r 0.1
vdisplay r
vsetmaterial r plastic
@ -75,4 +78,10 @@ vbsdf r -kd 0.5 0.9 0.3 -ks 0.0 -kr 0.3 -n
vbsdf r -fresnel Constant 1.0
vsetlocation r 0.5 0.65 0.1
puts "Trying path tracing mode..."
vrenderparams -ray -gi -rayDepth 8
puts "Make several path tracing iterations to refine the picture, please wait..."
vfps 100
puts "Done. To improve the image further, or after view manipulations, give command:"
puts "vfps \[nb_iteratons\]"