1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0032208: Tests - refactor visualization tests to cover several graphic drivers

Removed testgrids 'bugs/vis' and '3rdparty'; tests have been redistributed across other grids.
Moved testgrid 'v3d/ivtk' into dedicated 'vtk/ivtk'.

Added testgrid 'vselect' dedicated to 3D viewer picking/selection functionality
and filled with tests from 'v3d/vertex', 'v3d/face' and similar groups.

Added testgrid 'opengl' dedicated to OpenGL driver low-level functionality (GLSL programs and similar)
and filled with tests from 'v3d/glsl', 'v3d/raytrace', '3rdparty/fonts', 'bugs/vis' (portion) and similar.

Added testgrid 'opengles3' dedicated to OpenGL ES 3.0 driver low-level functionality
and reusing tests from 'opengl' testgrid.
Subgroup 'opengles3/raytrace' is disabled on Windows, as Ray-Tracing currently requires OpenGL ES 3.2.
while ANGLE library implements only OpenGL ES 3.0.

Added testgrid 'opengles2' dedicated to OpenGL ES 2.0 driver low-level functionality
and reusing a limited subset of passing tests from 'opengl' testgrid.
Currently testgrid is activated only on Windows platform when using ANGLE library
(properietary OpenGL ES drivers do not allow creation of restricted 2.0 context).

Test cases have been cleaned out to put bug description into log,
to properly load necessary plugins and to explicitly dump viewer.
This commit is contained in:
kgv
2021-03-22 12:29:04 +03:00
committed by bugmaster
parent a076535090
commit 0d828ac838
1891 changed files with 4279 additions and 6199 deletions

View File

@@ -0,0 +1,32 @@
puts "========"
puts "0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source"
puts "Test shadow map from single directional light source on a buggy."
puts "========"
pload MODELING VISUALIZATION XDE OCAF
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
Close D -silent
ReadGltf D [locate_data_file bug30691_Buggy.glb]
vclear
vinit View1
vzbufftrihedron
XDisplay -dispMode 1 D
vfit
vzoom 0.75
box bb -500000 -500000 -10875 1000000 1000000 0 -preview
vdisplay -dispMode 1 bb
vaspects bb -material STONE
vlight -change 0 -head 0 -dir -1 -1 -1 -castShadows 1
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
vraytrace 1
vdump $::imagedir/${::casename}_raytrace.png
}
vraytrace 0
vrenderparams -shadingModel phong
vrenderparams -shadowMapResolution 2048
vdump $::imagedir/${::casename}_phong.png
vrenderparams -shadingModel pbr
vdump $::imagedir/${::casename}_pbr.png

View File

@@ -0,0 +1,32 @@
puts "========"
puts "0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source"
puts "Test shadow map from a single directional light source on a box geometry."
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
vrenderparams -shadingModel PHONG
vdisplay -dispMode 1 b bb
vaspects bb -material STONE
vfit
vlight -change 0 -castShadows 1 -direction 1 1 -1 -head 0
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
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

View File

@@ -0,0 +1,36 @@
puts "========"
puts "0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source"
puts "Test shadow map from two directional light sources on a box geometry."
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
vrenderparams -shadingModel PHONG
vdisplay -dispMode 1 b bb
vaspects bb -material STONE
vfit
vlight -clear
vlight -add AMBIENT
vlight -add DIRECTIONAL -direction 0.2 0.2 -1 -head 0 -castShadows 1 -color RED
vlight -add DIRECTIONAL -direction -0.2 -0.2 -1 -head 0 -castShadows 1 -color GREEN
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
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

View File

@@ -0,0 +1,34 @@
puts "========"
puts "0030640: Visualization, Graphic3d_Camera - add option creating Projection matrix with 0 to 1 depth range"
puts "Test shadow map from a single directional light source on a box geometry."
puts "========"
pload MODELING VISUALIZATION
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
vcaps -depthZeroToOne 1
box b 1 2 3
box bb -5 -5 0 10 10 0 -preview
vgldebug 1
vcaps -core
vcaps -vsync 0
vclear
vinit View1
vrenderparams -shadingModel PHONG
vdisplay -dispMode 1 b bb
vaspects bb -material STONE
vfit
vselect 250 200
vlight -change 0 -castShadows 1 -direction 1 1 -1 -head 0
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
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

View File

@@ -0,0 +1,33 @@
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
if { ![string match "OpenGL ES 2.0*" [vglinfo VERSION]] && ![string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
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

View File

@@ -0,0 +1,23 @@
puts "========"
puts "0032129: Visualization, TKOpenGl - shadowmap is broken for ZLayer having non-zero origin"
puts "========"
pload MODELING VISUALIZATION
box b 0 0 1 100 200 300
box bb -500 -500 0 1000 1000 0 -preview
vinit View1
vrenderparams -shadingModel PHONG
vdisplay -dispMode 1 b bb
vaspects bb -material STONE
vfit
vlight -change 0 -castShadows 1 -head 0 -dir 1 1 -1
vdump $::imagedir/${::casename}_1.png
vzlayer DEFAULT -origin 200 0 0
vdump $::imagedir/${::casename}_2.png
vlocation b -setLocation 1000000000 0 0
vlocation bb -setLocation 1000000000 0 0
vfit
vdump $::imagedir/${::casename}_3.png
vzlayer DEFAULT -origin 1000000000 0 0
vdump $::imagedir/${::casename}_4.png