64c759f8 |
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 |
64c759f8 |
9 | vclear |
8e0a2b19 |
10 | vclose ALL |
11 | vinit View1 |
64c759f8 |
12 | vsetdispmode 1 |
13 | vaxo |
14 | vdisplay b |
15 | vsetmaterial b PLASTIC |
16 | vsetcolor b GREEN |
17 | vfit |
18 | vrotate 0.2 0.0 0.0 |
19 | |
20 | # take snapshot with fixed pipeline |
21 | vdump $::imagedir/${::casename}_OFF.png |
22 | set aColorL [vreadpixel 150 250 rgb name] |
23 | set aColorR [vreadpixel 250 250 rgb name] |
24 | if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } { |
25 | puts "Error: wrong color (fixed pipeline)!" |
26 | } |
27 | |
28 | vshaderprog b phong |
29 | set aColorL [vreadpixel 150 250 rgb name] |
30 | set aColorR [vreadpixel 250 250 rgb name] |
31 | if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } { |
32 | puts "Error: wrong color (Phong shader)!" |
33 | } |