1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-09 18:50:54 +03:00
occt/tests/v3d/raytrace/bug25201
kgv 992ed6b3c0 0029290: Visualization, TKOpenGl - allow defining Light source per ZLayer
Graphic3d_CLight is now defined as a class inheriting Standard_Transient,
so that it's fields now should be accessed through methods.
Graphic3d_CLight::IsEnabled() - new property allowing to disable light source everywhere.
Confusing alias OpenGl_Light has been removed.

Graphic3d_CLight::SetAttenuation() - the upper limit 1.0 of attenuation factors has been removed
since it contradicts to OpenGL specs and does not make sense.

Graphic3d_ZLayerSettings::Lights() - light sources list is now property of ZLayer.
When defined, it overrides light sources defined for View/Viewer.
New class Graphic3d_LightSet has been defined to define a set of light sources.

V3d_Light - removed obsolete interface for debug drawing lights sources.
V3d_Light is now an alias to Graphic3d_CLight.
V3d_TypeOfLight is now defined as a typedef to Graphic3d_TypeOfLightSource.
2017-11-30 23:09:23 +03:00

53 lines
1.0 KiB
Plaintext

puts "========"
puts "OCC25201: Visualization - Implementing soft shadows and ambient occlusion in OCCT ray-tracing core"
puts "========"
# custom shapes
set aShape1 [locate_data_file occ/Top.brep]
set aShape2 [locate_data_file occ/Bottom.brep]
# setup 3D viewer content
vinit name=View1 w=512 h=512
vglinfo
vvbo 0
vsetdispmode 1
vsetgradientbg 180 200 255 180 180 180 2
vtextureenv on 4
restore $aShape1 s1
restore $aShape2 s2
vdisplay s1 s2
vsetmaterial s1 Gold
vsetmaterial s2 Silver
vsetlocation s1 0.0 0.1 0.0
vlight -change 0 -dir 0.667 -0.667 -0.333
vturnview 3.0 -1.2 -0.1
vfit
# activate path tracing
vrenderparams -raytrace
vrenderparams -gi
vrenderparams -rayDepth 12
set aModeNum 0
vlight change 0 sm 0.1
vlight change 0 int 100
vbsdf s1 roughness 6400
vfps 200
vdump $imagedir/${casename}_${aModeNum}.png
incr aModeNum
vsetmaterial s1 glass
vbsdf s1 absorpcoeff 1.0
vfps 200
vdump $imagedir/${casename}_${aModeNum}.png
incr aModeNum
vsetmaterial s2 plaster
vfps 200
vdump $imagedir/${casename}_${aModeNum}.png
incr aModeNum