1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
occt/tests/v3d/glsl/phong_pos4
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

36 lines
1.0 KiB
Plaintext

puts "========"
puts "0029283: Visualization - allow defining more than 8 light sources"
puts "Test case creates about 100 of light sources."
puts "========"
pload MODELING VISUALIZATION
vclear
vclose ALL
vinit View1
vcaps -ffp 0
vrenderparams -shadingModel phong
box b -50 5 -50 100 100 100
vdisplay -dispMode 1 b
vfront
vfit
# define lights
set THE_COLORS { RED1 YELLOW BLUE1 CYAN1 PURPLE WHITE HOTPINK GREEN MAGENTA1 MAGENTA3 }
vlight clear
set aNbColors 10
set aLightIndex 0
set aConstAtten 0.1
set aLinAtten 1
set aRand [expr srand(1)]
for { set anZIter -50 } { $anZIter <= 50 } { set anZIter [expr $anZIter + 10] } {
for { set anXIter -50 } { $anXIter <= 50 } { set anXIter [expr $anXIter + 10] } {
set anIndex [expr {int(rand() * $aNbColors)}]
set aColor [lindex $THE_COLORS $anIndex]
set aPos "$anXIter 0 $anZIter"
vlight -add positional -pos {*}$aPos -color $aColor -headLight 0 -constAttenuation $aConstAtten -linearAttenuation $aLinAtten
vpoint v${aLightIndex} {*}$aPos
set aLightIndex [expr $aLightIndex + 1]
}
}