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 | |
8e0a2b19 |
6 | vclear |
7 | vclose ALL |
8 | vinit View1 |
9 | |
5f4bd4d4 |
10 | # create objects |
11 | set anX 0.001 |
12 | circle c 0 0 0 0.001 |
13 | mkedge e c |
14 | wire w e |
15 | plane s |
16 | mkface f1 s w |
17 | mkface f2 s w |
18 | ttranslate f1 $anX -0.001 0 |
19 | |
20 | # display objects |
21 | vtop |
22 | vdisplay -dispMode 1 f1 f2 |
23 | vsetlocation f2 $anX 0.001 0 |
24 | vpoint vl $anX 0 0.001 |
25 | vfit |
26 | |
27 | # setup light |
28 | vcaps -ffp 0 |
29 | vrenderparams -shadingModel phong |
30 | vlight clear |
31 | vlight add spotLight pos $anX 0 0.001 dir 0 0 -1 angle 60 constAtten 0.1 exponent 0.1 color RED1 headLight 0 |
32 | |
33 | set aColor1 [vreadpixel 205 180 rgb name] |
34 | set aColor2 [vreadpixel 205 220 rgb name] |
35 | if { "$aColor1" != "RED" || "$aColor2" != "RED" } { |
36 | puts "Error: expected color near the light spot is RED" |
37 | } |
38 | |
39 | set aColor3 [vreadpixel 205 132 rgb name] |
40 | set aColor4 [vreadpixel 205 280 rgb name] |
41 | if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } { |
42 | puts "Error: expected color mid from the light spot is RED4" |
43 | } |
44 | |
45 | set aColor5 [vreadpixel 205 100 rgb name] |
46 | set aColor6 [vreadpixel 205 306 rgb name] |
ba00aab7 |
47 | if { "$aColor5" != "GRAY7" || "$aColor6" != "GRAY8" } { |
48 | puts "Error: expected color far from the light spot is GRAY7" |
5f4bd4d4 |
49 | } |