0029350: Visualization, OpenGl_Text - add Aspect_TODT_SHADOW text style
[occt.git] / tests / v3d / glsl / phong_pos1
... / ...
CommitLineData
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
6vclear
7vclose ALL
8vinit View1
9
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
26
27# setup light
28vcaps -ffp 0
29vrenderparams -shadingModel phong
30vlight clear
31vlight add positional pos $anX 0 0.001 color RED1 headLight 0
32
33set aColor1 [vreadpixel 205 180 rgb name]
34set aColor2 [vreadpixel 205 220 rgb name]
35if { "$aColor1" != "RED" || "$aColor2" != "RED" } {
36 puts "Error: expected color near the light spot is RED"
37}
38
39set aColor3 [vreadpixel 205 132 rgb name]
40set aColor4 [vreadpixel 205 280 rgb name]
41if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } {
42 puts "Error: expected color mid from the light spot is RED4"
43}
44
45set aColor5 [vreadpixel 205 100 rgb name]
46set aColor6 [vreadpixel 205 306 rgb name]
47if { "$aColor5" != "RED4" || "$aColor6" != "RED4" } {
48 puts "Error: expected color far from the light spot is RED4"
49}