0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / tests / v3d / glsl / shading_models
CommitLineData
dc89236f 1puts "========"
2puts "Test various Shading Models assigned per-object"
3puts "========"
4
5# setup viewer
6vclear
7vclose ALL
8vinit View1 -width 912 -height 912
9
10# define spheres with a rough triangulation to easily distinguish Shading Models
9f013fee 11psphere p0 10
12copytranslate p11 p0 0 0 0
13copytranslate p12 p0 40 0 0
14copytranslate p21 p0 0 20 0
15copytranslate p22 p0 40 20 0
16copytranslate p31 p0 0 40 0
17copytranslate p32 p0 40 40 0
18compound p11 p12 p21 p22 p31 p32 ss
dc89236f 19incmesh ss 1
20vdefaults -autoTriang 0
21
22# display objects
9f013fee 23vdisplay -dispMode 1 p11 p12 p21 p22 p31 p32
24vdrawparray 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
25vdrawparray 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
dc89236f 26vtop
27vrotate -0.9 0.1 0
28vfit
08669adf 29
30vcaps -ffp 1
31vdump $::imagedir/${::casename}_defaults_ffp.png
32
33vcaps -ffp 0
dc89236f 34vdump $::imagedir/${::casename}_defaults.png
35
36# customize shading models
9f013fee 37vaspects p11 -setShadingModel VERTEX
38vdrawtext t11 Graphic3d_TOSM_VERTEX -pos 10 5 10 -color RED -aspect BOLD
39vaspects p12 -setShadingModel FRAGMENT
40vdrawtext t12 Graphic3d_TOSM_FRAGMENT -pos 50 5 10 -color RED -aspect BOLD
41
42vaspects p21 -setShadingModel PBR
43vdrawtext t21 Graphic3d_TOSM_PBR -pos 10 25 10 -color RED -aspect BOLD
44vaspects p22 -setShadingModel PBR_FACET
45vdrawtext t22 Graphic3d_TOSM_PBR_FACET -pos 50 25 10 -color RED -aspect BOLD
46
47vaspects p31 -setShadingModel UNLIT
48vdrawtext t31 Graphic3d_TOSM_UNLIT -pos 10 45 10 -color RED -aspect BOLD
49vaspects p32 -setShadingModel FACET
50vdrawtext t32 Graphic3d_TOSM_FACET -pos 50 45 10 -color RED -aspect BOLD
51vaspects p41 -setShadingModel VERTEX
52vdrawtext t41 Graphic3d_TOSM_VERTEX -pos 10 65 10 -color RED -aspect BOLD
53vaspects p42 -setShadingModel FACET
54vdrawtext t42 Graphic3d_TOSM_FACET -pos 50 65 10 -color RED -aspect BOLD
55vdisplay -topmost t11 t12 t21 t22 t31 t32 t41 t42
08669adf 56
57vcaps -ffp 1
58vdump $::imagedir/${::casename}_ffp.png
59
60vcaps -ffp 0
9f013fee 61vlight -change 1 -intensity 0.1
62vrenderparams -shadingModel pbr
dc89236f 63vdump $::imagedir/${::casename}.png