0032121: Draw Harness, ViewerTest - implement -reset option for vlight command
[occt.git] / tests / opengl / data / shading / phong_spot1
CommitLineData
5f4bd4d4 1puts "========"
2puts "Per-fragment lighting using built-in GLSL program, one spot light source."
3puts "Visual comparison with the reference snapshot should be performed for this test case."
4puts "========"
5
0d828ac8 6pload MODELING VISUALIZATION
8e0a2b19 7vclear
8vclose ALL
9vinit View1
10
5f4bd4d4 11# create objects
12set anX 0.001
13circle c 0 0 0 0.001
14mkedge e c
15wire w e
16plane s
17mkface f1 s w
18mkface f2 s w
19ttranslate f1 $anX -0.001 0
20
21# display objects
22vtop
23vdisplay -dispMode 1 f1 f2
24vsetlocation f2 $anX 0.001 0
25vpoint vl $anX 0 0.001
26vfit
27
28# setup light
29vcaps -ffp 0
30vrenderparams -shadingModel phong
06d40093 31vlight -clear
32vlight spot -type SPOTLIGHT -pos $anX 0 0.001 -dir 0 0 -1 -spotAngle 60 -constAtten 0.1 -exponent 0.1 -color RED1 -headLight 0
5f4bd4d4 33
34set aColor1 [vreadpixel 205 180 rgb name]
35set aColor2 [vreadpixel 205 220 rgb name]
36if { "$aColor1" != "RED" || "$aColor2" != "RED" } {
37 puts "Error: expected color near the light spot is RED"
38}
39
40set aColor3 [vreadpixel 205 132 rgb name]
41set aColor4 [vreadpixel 205 280 rgb name]
42if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } {
43 puts "Error: expected color mid from the light spot is RED4"
44}
45
46set aColor5 [vreadpixel 205 100 rgb name]
47set aColor6 [vreadpixel 205 306 rgb name]
ba00aab7 48if { "$aColor5" != "GRAY7" || "$aColor6" != "GRAY8" } {
0d828ac8 49 if { "$aColor5" != "GRAY2" && "$aColor6" != "GRAY2" } {
50 puts "Error: expected color far from the light spot is GRAY7"
51 }
5f4bd4d4 52}
0d828ac8 53vdump ${imagedir}/${casename}.png