0024344: TKOpenGl - only front side is lighted within Phong GLSL program
[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
10vinit View1
11vclear
12vsetdispmode 1
13vaxo
14vdisplay b_1 b_2
15vfit
16vrotate 0.2 0.0 0.0
17
18# take snapshot with fixed pipeline
19vdump $::imagedir/${::casename}_OFF.png
20set aColorB [vreadpixel 150 150 rgb name]
21set aColorF [vreadpixel 250 250 rgb name]
22if { "$aColorB" != "$aColorF"} {
23 puts "Error: front/back colors are different!"
24}
25set aColorFixed $aColorF
26
27# activate phong shader
28vshaderprog phong
29set aColorB [vreadpixel 150 150 rgb name]
30set aColorF [vreadpixel 250 250 rgb name]
31if { "$aColorB" != "$aColorF"} {
32 puts "Error: front/back colors are different!"
33}
34
35if { "$aColorF" != "$aColorFixed"} {
36 puts "Error: colors are different!"
37}