0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
[occt.git] / tests / v3d / glsl / phong_pos1
CommitLineData
5f4bd4d4 1puts "========"
2puts "Per-fragment lighting using built-in GLSL program, one positional light source."
3puts "Visual comparison with the reference snapshot should be performed for this test case."
4puts "========"
5
8e0a2b19 6vclear
7vclose ALL
8vinit View1
9
5f4bd4d4 10# create objects
11set anX 0.001
12circle c 0 0 0 0.001
13mkedge e c
14wire w e
15plane s
16mkface f1 s w
17mkface f2 s w
18ttranslate f1 $anX -0.001 0
19
20# display objects
21vtop
22vdisplay -dispMode 1 f1 f2
23vsetlocation f2 $anX 0.001 0
24vpoint vl $anX 0 0.001
25vfit
992ed6b3 26vzbufftrihedron
5f4bd4d4 27
28# setup light
29vcaps -ffp 0
30vrenderparams -shadingModel phong
992ed6b3 31vlight -layer default -clear
32vlight -layer default -add positional -pos $anX 0 0.001 -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]
48if { "$aColor5" != "RED4" || "$aColor6" != "RED4" } {
49 puts "Error: expected color far from the light spot is RED4"
50}