mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
38 lines
813 B
Plaintext
38 lines
813 B
Plaintext
puts "========"
|
|
puts "Per-pixel lighting using GLSL program (Phong shading), check lighting of back faces"
|
|
puts "========"
|
|
|
|
# create box
|
|
box b 1 2 3
|
|
explode b F
|
|
|
|
# draw box
|
|
vinit View1
|
|
vclear
|
|
vsetdispmode 1
|
|
vaxo
|
|
vdisplay b_1 b_2
|
|
vfit
|
|
vrotate 0.2 0.0 0.0
|
|
|
|
# take snapshot with fixed pipeline
|
|
vdump $::imagedir/${::casename}_OFF.png
|
|
set aColorB [vreadpixel 150 150 rgb name]
|
|
set aColorF [vreadpixel 250 250 rgb name]
|
|
if { "$aColorB" != "$aColorF"} {
|
|
puts "Error: front/back colors are different!"
|
|
}
|
|
set aColorFixed $aColorF
|
|
|
|
# activate phong shader
|
|
vshaderprog phong
|
|
set aColorB [vreadpixel 150 150 rgb name]
|
|
set aColorF [vreadpixel 250 250 rgb name]
|
|
if { "$aColorB" != "$aColorF"} {
|
|
puts "Error: front/back colors are different!"
|
|
}
|
|
|
|
if { "$aColorF" != "$aColorFixed"} {
|
|
puts "Error: colors are different!"
|
|
}
|