0031999: Tests - request Core Profile on macOS for Ray-Tracing tests
[occt.git] / tests / v3d / glsl / transp1
CommitLineData
9f013fee 1puts "========"
2puts "Test various Shading Models assigned per-object with transparency"
3puts "========"
4
ba562b2b 5# PBR doesn't work with Compatible Profile on macOS
6if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
7
9f013fee 8# setup viewer
9vclear
10vclose ALL
11vinit View1 -width 912 -height 912
12
13# define spheres with a rough triangulation to easily distinguish Shading Models
14psphere p0 10
15box b0 4 4 4
16copytranslate p11 p0 0 0 0
17copytranslate b11 b0 0 0 0
18copytranslate p12 p0 40 0 0
19copytranslate b12 b0 40 0 0
20copytranslate p21 p0 0 20 0
21copytranslate b21 b0 0 20 0
22copytranslate p22 p0 40 20 0
23copytranslate b22 b0 40 20 0
24copytranslate p31 p0 0 40 0
25copytranslate b31 b0 0 40 0
26copytranslate p32 p0 40 40 0
27copytranslate b32 b0 40 40 0
28compound p11 p12 p21 p22 p31 p32 b11 b12 b21 b22 b31 b32 ss
29incmesh ss 1
30vdefaults -autoTriang 0
31
32# display objects
33vdisplay -dispMode 1 p11 p12 p21 p22 p31 p32 b11 b12 b21 b22 b31 b32
34vdrawparray p41 triangles v 0 55 0 v 0 75 0 v 20 55 0 v 0 55 0 v 0 75 0 v 0 55 20 v 0 55 0 v 0 55 20 v 20 55 0 v 0 75 0 v 0 55 20 v 20 55 0
35vdrawparray p42 triangles v 40 55 0 v 40 75 0 v 60 55 0 v 40 55 0 v 40 75 0 v 40 55 20 v 40 55 0 v 40 55 20 v 60 55 0 v 40 75 0 v 40 55 20 v 60 55 0
36vtop
37vrotate -0.9 0.1 0
38vfit
39
40set aMatProps "-setMaterial DIAMOND -setColor GRAY70 -setTransparency 0.8"
41
42# customize shading models
43vaspects b11 b12 b21 b22 b31 b32 -setShadingModel FRAGMENT -setColor RED
44
45vaspects p11 -setShadingModel VERTEX {*}$aMatProps
46vdrawtext t11 Graphic3d_TOSM_VERTEX -pos 10 5 10 -color RED -aspect BOLD
47vaspects p12 -setShadingModel FRAGMENT {*}$aMatProps
48vdrawtext t12 Graphic3d_TOSM_FRAGMENT -pos 50 5 10 -color RED -aspect BOLD
49
50vaspects p21 -setShadingModel PBR {*}$aMatProps
51vdrawtext t21 Graphic3d_TOSM_PBR -pos 10 25 10 -color RED -aspect BOLD
52vaspects p22 -setShadingModel PBR_FACET {*}$aMatProps
53vdrawtext t22 Graphic3d_TOSM_PBR_FACET -pos 50 25 10 -color RED -aspect BOLD
54
55vaspects p31 -setShadingModel UNLIT {*}$aMatProps
56vdrawtext t31 Graphic3d_TOSM_UNLIT -pos 10 45 10 -color RED -aspect BOLD
57vaspects p32 -setShadingModel FACET {*}$aMatProps
58vdrawtext t32 Graphic3d_TOSM_FACET -pos 50 45 10 -color RED -aspect BOLD
59vaspects p41 -setShadingModel VERTEX {*}$aMatProps
60vdrawtext t41 Graphic3d_TOSM_VERTEX -pos 10 65 10 -color RED -aspect BOLD
61vaspects p42 -setShadingModel FACET {*}$aMatProps
62vdrawtext t42 Graphic3d_TOSM_FACET -pos 50 65 10 -color RED -aspect BOLD
63vdisplay -topmost t11 t12 t21 t22 t31 t32 t41 t42
64
65vlight -change 0 -intensity 1.0
66vlight -change 1 -intensity 0.5
67vrenderparams -shadingModel pbr
68vdump $::imagedir/${::casename}.png