0032237: Visualization, TKOpenGl - fix Gouraud shading within perspective camera...
[occt.git] / tests / v3d / glsl / phong_sides
CommitLineData
c90e941f 1puts "========"
2puts "Per-pixel lighting using GLSL program (Phong shading), check lighting of back faces"
3puts "========"
4
5# create box
6box b 1 2 3
7explode b F
8
9# draw box
c90e941f 10vclear
8e0a2b19 11vclose ALL
12vinit View1
c90e941f 13vsetdispmode 1
14vaxo
15vdisplay b_1 b_2
16vfit
17vrotate 0.2 0.0 0.0
18
19# take snapshot with fixed pipeline
20vdump $::imagedir/${::casename}_OFF.png
21set aColorB [vreadpixel 150 150 rgb name]
22set aColorF [vreadpixel 250 250 rgb name]
23if { "$aColorB" != "$aColorF"} {
24 puts "Error: front/back colors are different!"
25}
26set aColorFixed $aColorF
27
28# activate phong shader
29vshaderprog phong
30set aColorB [vreadpixel 150 150 rgb name]
31set aColorF [vreadpixel 250 250 rgb name]
32if { "$aColorB" != "$aColorF"} {
33 puts "Error: front/back colors are different!"
34}
35
36if { "$aColorF" != "$aColorFixed"} {
37 puts "Error: colors are different!"
38}