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/bug24819
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

74 lines
1.6 KiB
Plaintext

puts "========"
puts "OCC24819: TKOpenGl - extend the ray-tracing core by visualization of lines, text and point sprites"
puts "========"
vfont add [locate_data_file DejaVuSans.ttf] SansFont
# setup 3D viewer content
vinit name=View1 w=512 h=512
vglinfo
vvbo 0
vsetdispmode 1
vsetgradientbg 180 200 255 180 180 180 2
# boxes
box b1 1 1 1
vdisplay b1
vsetlocation b1 0 0 0.001
vsetmaterial b1 Silver
vsettransparency b1 0.5
box b2 3 2 2 1 2 1
vdisplay b2
vsetmaterial b2 Pewter
vsettransparency b2 0.8
# brep text
text2brep t "text" -font "SansFont" -height 8
vdisplay t
# overlay objects
vdrawtext t1 "Overlay text!" -2d -perspos -1 1 -pos 200 -440 0 -height 40 -font SansFont
# markers
vpoint p 1 1 1
vdisplay p
vmarkerstest mTest 7 -3 0 PointsOnSide=5 MarkerType=5
# 3d text
vdrawtext text0 3D_Text -pos 1 2 2 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 20 -aspect regular -font SansFont
vlight -change 0 -dir 0.577 -0.577 -0.577
vfit
# trihedron
vzbufftrihedron
# activate ray-tracing
vrenderparams -raytrace
# orthogonal projection
set aModeNum 0
foreach aFSAAMode {on off} {
foreach aReflMode {on off} {
foreach aShadMode {on off} {
vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode
vdump $imagedir/${casename}_${aModeNum}.png
incr aModeNum
}
}
}
# perspective projection
vcamera -persp
set aModeNum 0
foreach aFSAAMode {on off} {
foreach aReflMode {on off} {
foreach aShadMode {on off} {
vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode
vdump $imagedir/${casename}_${aModeNum}.png
incr aModeNum
}
}
}