0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / tests / v3d / glsl / pbr_attenuation
CommitLineData
88b312d3 1puts "========"
2puts "0031099: Visualization, TKOpenGl - support Point light source with artistic full cut-off distance"
3puts "Test of point light's (positional and spot) attenuation and range in PBR"
4puts "========"
5
6pload XDE OCAF VISUALIZATION MODELING
7catch { Close D }
8
9vclear
10vclose ALL
11vinit View1 -w 512 -h 512
12
13vtop
14vrenderparams -shadingmodel pbr
15
16box b -2 -2 -0.00001 4 4 0.00001
17XNewDoc D
18set bs [XAddShape D b 0]
19XAddVisMaterial D m -baseColor WHITE -transparency 0.0 -metallic 0.0 -roughness 1.0
20XSetVisMaterial D $bs m
21XDisplay -dispMode 1 D
22vfit
23
24vlight -clear
25vlight -add positional -pos -1 0 1 -intensity 0.5
26vlight -add spot -pos 1 0 1 -dir 0 0 -1 -intensity 0.5 -angle 100
27
28vdump $::imagedir/${::casename}_norange_high.png
29
30vlight -change 0 -pos -1 0 0.5
31vlight -change 1 -pos 1 0 0.5
32
33vdump $::imagedir/${::casename}_norange_low.png
34
35vlight -change 0 -range 1
36vlight -change 1 -range 1
37
38vdump $::imagedir/${::casename}_range1.png
39
40vlight -change 0 -range 0.5
41vlight -change 1 -range 0.5
42
43vdump $::imagedir/${::casename}_range0_5.png
44
45vlight -change 0 -range 0.6
46vlight -change 1 -range 0.6
47
48vdump $::imagedir/${::casename}_range0_6.png
49
50vlight -change 0 -range 10
51vlight -change 1 -range 10
52
53vdump $::imagedir/${::casename}_range10.png
54
55box b -5.0 -5.0 -0.00001 10 10 0.00001
56XNewDoc D
57set bs [XAddShape D b 0]
58XAddVisMaterial D m -baseColor WHITE -transparency 0.0 -metallic 0.0 -roughness 1.0
59XSetVisMaterial D $bs m
60XDisplay -dispMode 1 D
61vfit
62vlight -clear
63for {set i 0} {$i < 5} {incr i} {
64 for {set j 0} {$j < 5} {incr j} {
65 vlight -add spot -pos [expr -4.0+2.0*$i] [expr -4.0+2.0*$j] 0.5 -dir 0 0 -1 -intensity 0.5 -angle 100 -exp [expr ($i*5+$j) / 24.0]
66 }
67}
68
69vdump $::imagedir/${::casename}_angle_attenuation.png