0027943: Visualization - fix broken shading by positional light for object with local...
[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
6# create objects
7set anX 0.001
8circle c 0 0 0 0.001
9mkedge e c
10wire w e
11plane s
12mkface f1 s w
13mkface f2 s w
14ttranslate f1 $anX -0.001 0
15
16# display objects
17vtop
18vdisplay -dispMode 1 f1 f2
19vsetlocation f2 $anX 0.001 0
20vpoint vl $anX 0 0.001
21vfit
22
23# setup light
24vcaps -ffp 0
25vrenderparams -shadingModel phong
26vlight clear
27vlight add positional pos $anX 0 0.001 color RED1 headLight 0
28
29set aColor1 [vreadpixel 205 180 rgb name]
30set aColor2 [vreadpixel 205 220 rgb name]
31if { "$aColor1" != "RED" || "$aColor2" != "RED" } {
32 puts "Error: expected color near the light spot is RED"
33}
34
35set aColor3 [vreadpixel 205 132 rgb name]
36set aColor4 [vreadpixel 205 280 rgb name]
37if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } {
38 puts "Error: expected color mid from the light spot is RED4"
39}
40
41set aColor5 [vreadpixel 205 100 rgb name]
42set aColor6 [vreadpixel 205 306 rgb name]
43if { "$aColor5" != "RED4" || "$aColor6" != "RED4" } {
44 puts "Error: expected color far from the light spot is RED4"
45}