puts "========"
puts "Per-pixel lighting using GLSL program (Phong shading)"
puts "========"

# import model
restore [locate_data_file occ/fuse.brep] f
tclean f

# draw box
vinit View1
vclear
vdefaults -absDefl 0.5
vsetdispmode 1
vaxo
vdisplay f
vfit
vrotate -0.5 0.0 0.0
vfit

# setup lights
vlight delete 0
vlight delete 0
vlight delete 0
vlight delete 0
vlight delete 0
vlight add ambient                color WHITE
vlight add directional dir  1 0 0 color GREEN headlight 1
vlight add directional dir -1 0 0 color RED1  headlight 1

# take snapshot with fixed pipeline
vdump $::imagedir/${::casename}_OFF.png
vshaderprog f phong
vdump $::imagedir/${::casename}_ph1.png

vclear
vdisplay f
vshaderprog f phong
vdump $::imagedir/${::casename}_ph2.png
vmoveto 250 250
