1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +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 @@
######################################################################### # Script demonstrating Global illumination effects using non-interactive
# 26437: Visualization - Improve path tracing rendering engine # path tracing rendering engine in 3d view
#########################################################################
pload ALL #Category: Visualization
#Title: Path tracing
pload MODELING VISUALIZATION
# setup 3D viewer content # setup 3D viewer content
vinit name=View1 w=512 h=512 vinit name=View1 w=512 h=512
vglinfo vglinfo
vvbo 0 # setup light sources
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
vlight del 0 vlight del 0
vlight del 1 vlight del 1
vlight add positional head 0 pos 0.5 0.5 0.85 vlight add positional head 0 pos 0.5 0.5 0.85
vlight change 0 sm 0.06 vlight change 0 sm 0.06
vlight change 0 int 60.0 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 psphere s 0.2
vdisplay s vdisplay s
vsetlocation s 0.21 0.3 0.2 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 -absorpcolor 0.8 0.8 1.0
vbsdf s -absorpcoeff 6 vbsdf s -absorpcoeff 6
# setup first inner box
box c 0.3 0.3 0.2 box c 0.3 0.3 0.2
vdisplay c vdisplay c
vsetlocation c 0.55 0.3 0.0 vsetlocation c 0.55 0.3 0.0
@ -60,6 +61,7 @@ vlocrotate c 0 0 0 0 0 1 -30
vsetmaterial c plastic vsetmaterial c plastic
vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n 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 box g 0.15 0.15 0.3
vdisplay g vdisplay g
vsetlocation g 0.7 0.25 0.2 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 -absorpcolor 0.8 1.0 0.8
vbsdf g -absorpcoeff 6 vbsdf g -absorpcoeff 6
# setup second inner sphere
psphere r 0.1 psphere r 0.1
vdisplay r vdisplay r
vsetmaterial r plastic 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 vbsdf r -fresnel Constant 1.0
vsetlocation r 0.5 0.65 0.1 vsetlocation r 0.5 0.65 0.1
puts "Trying path tracing mode..."
vrenderparams -ray -gi -rayDepth 8 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\]"