mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-25 12:55:50 +03:00
Graphic3d_CLight::ToCastShadows() - added new property defining if light should cast shadows (ignored by Ray-Tracing). OpenGl_ShaderManager::stdComputeLighting() now implements shadow mapping for directional lights. OpenGl_ShaderManager::prepareGeomMainSrc() now handles copying of arrays. OpenGl_Context::ShadowMapTexUnit() - added property defining an offset for shadow map texture units. OpenGl_ShadowMap - added new class storing shadow map FBO with parameters. OpenGl_View::prepareFrameBuffers() - added resizing of shadow map FBOs. OpenGl_View::Redraw() - added section redrawing scene into shadow map FBOs via OpenGl_View::renderShadowMap() method. vrenderparams - added new parameters -shadowMapResolution and -shadowMapBias.
32 lines
826 B
Plaintext
32 lines
826 B
Plaintext
puts "========"
|
|
puts "0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source"
|
|
puts "Test shadow map from a single directional light source with headlight flag."
|
|
puts "========"
|
|
|
|
pload MODELING VISUALIZATION
|
|
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
|
box b 1 2 3
|
|
box bb -5 -5 0 10 10 0 -preview
|
|
vgldebug 1
|
|
vcaps -core
|
|
vcaps -vsync 0
|
|
vclear
|
|
vinit View1
|
|
vcamera -persp
|
|
vrenderparams -shadingModel PHONG
|
|
vdisplay -dispMode 1 b bb
|
|
vaspects bb -material STONE
|
|
vfit
|
|
vlight -change 0 -castShadows 1 -direction -0.2 0.2 -1 -head 1
|
|
|
|
vraytrace 1
|
|
vdump $::imagedir/${::casename}_raytrace.png
|
|
|
|
vraytrace 0
|
|
vrenderparams -shadingModel phong
|
|
vrenderparams -shadowMapBias 0.01
|
|
vdump $::imagedir/${::casename}_phong.png
|
|
|
|
vrenderparams -shadingModel pbr
|
|
vdump $::imagedir/${::casename}_pbr.png
|