1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-01 10:26:12 +03:00
occt/tests/v3d/glsl/phong_couple
kgv 1238134135 0024310: TKOpenGl - GLSL compatibility issues
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
2013-11-05 10:19:58 +04:00

31 lines
523 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
box b 2 0 0 1 0.5 0.25
# draw box
vinit View1
vclear
vdefaults absDefl=0.5
vsetdispmode 1
vaxo
vdisplay f
vfit
vrotate -0.5 0.0 0.0
vdisplay b
vfit
# take snapshot with fixed pipeline
vdump $::imagedir/${::casename}_OFF.png
vshaderprog f phong
vshaderprog b phong
vshaderprog b off
vrotate -0.2 0.0 0.0
vmoveto 100 100
vdump $::imagedir/${::casename}_ph1.png