mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
vlight command has been revised to provide more friendly syntax. Command now accepts light index or name as first argument. Added arguments -enable/-disable for managing enabled state. Added argument -reset to reset light parameters to default values. V3d_Viewer::SetDefaultLights() now sets names "headlight" and "ambient" to created lights. Graphic3d_TypeOfLightSource enumeration values have been renamed to avoid shortcuts. Draw::Atof(), applied corrections to avoid explicit new/delete calls.
38 lines
775 B
Plaintext
38 lines
775 B
Plaintext
puts "========"
|
|
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
|
puts "========"
|
|
|
|
pload MODELING VISUALIZATION
|
|
|
|
# import model
|
|
restore [locate_data_file occ/fuse.brep] f
|
|
tclean f
|
|
|
|
# draw box
|
|
vclear
|
|
vinit View1
|
|
vdefaults -absDefl 0.5
|
|
vsetdispmode 1
|
|
vaxo
|
|
vdisplay f
|
|
vfit
|
|
vrotate -0.5 0.0 0.0
|
|
vfit
|
|
|
|
# setup lights
|
|
vlight -clear
|
|
vlight amblight -type AMBIENT -color WHITE
|
|
vlight dirlight1 -type DIRECTIONAL -dir 1 0 0 -color GREEN -headlight 1
|
|
vlight dirlight2 -type 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
|