mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
Lights defintion clean up: - remove duplicated enumeration TLightType (equals to Visual3d_TypeOfLightSource) - remove unused fields from Graphic3d_CLight - OpenGl_Light, reuse Graphic3d_CLight definition Phong GLSL program: - move out cumulative ambient light intencity from limited list of lights - compatibility issues, replace array of structures (light sources, materials, clipping planes) with arrays of primitive types New Draw Harness command vlight to alter light sources definition. OpenGl_ShaderProgram::Initialize() - add missing Linker log
40 lines
766 B
Plaintext
40 lines
766 B
Plaintext
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
|