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_pos1
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

51 lines
1.3 KiB
Plaintext

puts "========"
puts "Per-fragment lighting using built-in GLSL program, one positional light source."
puts "Visual comparison with the reference snapshot should be performed for this test case."
puts "========"
vclear
vclose ALL
vinit View1
# create objects
set anX 0.001
circle c 0 0 0 0.001
mkedge e c
wire w e
plane s
mkface f1 s w
mkface f2 s w
ttranslate f1 $anX -0.001 0
# display objects
vtop
vdisplay -dispMode 1 f1 f2
vsetlocation f2 $anX 0.001 0
vpoint vl $anX 0 0.001
vfit
vzbufftrihedron
# setup light
vcaps -ffp 0
vrenderparams -shadingModel phong
vlight -layer default -clear
vlight -layer default -add positional -pos $anX 0 0.001 -color RED1 -headLight 0
set aColor1 [vreadpixel 205 180 rgb name]
set aColor2 [vreadpixel 205 220 rgb name]
if { "$aColor1" != "RED" || "$aColor2" != "RED" } {
puts "Error: expected color near the light spot is RED"
}
set aColor3 [vreadpixel 205 132 rgb name]
set aColor4 [vreadpixel 205 280 rgb name]
if { "$aColor3" != "RED4" || "$aColor4" != "RED4" } {
puts "Error: expected color mid from the light spot is RED4"
}
set aColor5 [vreadpixel 205 100 rgb name]
set aColor6 [vreadpixel 205 306 rgb name]
if { "$aColor5" != "RED4" || "$aColor6" != "RED4" } {
puts "Error: expected color far from the light spot is RED4"
}