c03aef2c8e0907c8e6a3a3a65b19fecbde0c867b
[occt.git] / tests / v3d / glsl / phong_plastic
1 puts "========"
2 puts "Per-pixel lighting using GLSL program (Phong shading), check plastic material"
3 puts "========"
4
5 # create box
6 box b 1 2 3
7
8 # draw box
9 vinit View1
10 vclear
11 vsetdispmode 1
12 vaxo
13 vdisplay     b
14 vsetmaterial b PLASTIC
15 vsetcolor    b GREEN
16 vfit
17 vrotate 0.2 0.0 0.0
18
19 # take snapshot with fixed pipeline
20 vdump $::imagedir/${::casename}_OFF.png
21 set aColorL [vreadpixel 150 250 rgb name]
22 set aColorR [vreadpixel 250 250 rgb name]
23 if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
24   puts "Error: wrong color (fixed pipeline)!"
25 }
26
27 vshaderprog b phong
28 set aColorL [vreadpixel 150 250 rgb name]
29 set aColorR [vreadpixel 250 250 rgb name]
30 if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
31   puts "Error: wrong color (Phong shader)!"
32 }