5f4bd4d4 |
1 | puts "========" |
2 | puts "Per-fragment lighting using built-in GLSL program, one spot light source." |
3 | puts "Visual comparison with the reference snapshot should be performed for this test case." |
4 | puts "========" |
5 | |
0d828ac8 |
6 | pload MODELING VISUALIZATION |
8e0a2b19 |
7 | vclear |
8 | vclose ALL |
9 | vinit View1 |
10 | |
5f4bd4d4 |
11 | # create objects |
12 | set anX 0.001 |
13 | circle c 0 0 0 0.001 |
14 | mkedge e c |
15 | wire w e |
16 | plane s |
17 | mkface f1 s w |
18 | mkface f2 s w |
19 | ttranslate f1 $anX -0.001 0 |
20 | |
21 | # display objects |
22 | vtop |
23 | vdisplay -dispMode 1 f1 f2 |
24 | vsetlocation f2 $anX 0.001 0 |
25 | vpoint vl $anX 0 0.001 |
26 | vfit |
27 | |
28 | # setup light |
29 | vcaps -ffp 0 |
30 | vrenderparams -shadingModel phong |
06d40093 |
31 | vlight -clear |
32 | vlight 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 | |
34 | set aColor1 [vreadpixel 205 180 rgb name] |
35 | set aColor2 [vreadpixel 205 220 rgb name] |
36 | if { "$aColor1" != "RED" || "$aColor2" != "RED" } { |
37 | puts "Error: expected color near the light spot is RED" |
38 | } |
39 | |
40 | set aColor3 [vreadpixel 205 132 rgb name] |
41 | set aColor4 [vreadpixel 205 280 rgb name] |
42 | if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } { |
43 | puts "Error: expected color mid from the light spot is RED4" |
44 | } |
45 | |
46 | set aColor5 [vreadpixel 205 100 rgb name] |
47 | set aColor6 [vreadpixel 205 306 rgb name] |
ba00aab7 |
48 | if { "$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 |
53 | vdump ${imagedir}/${casename}.png |