mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-02 17:46:22 +03:00
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.
69 lines
2.3 KiB
Plaintext
69 lines
2.3 KiB
Plaintext
puts "========"
|
|
puts "Test various Shading Models assigned per-object"
|
|
puts "========"
|
|
|
|
pload MODELING VISUALIZATION
|
|
|
|
# PBR doesn't work with Compatible Profile on macOS
|
|
#if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
|
|
|
# setup viewer
|
|
vclear
|
|
vclose ALL
|
|
vinit View1 -width 912 -height 912
|
|
|
|
# define spheres with a rough triangulation to easily distinguish Shading Models
|
|
psphere p0 10
|
|
copytranslate p11 p0 0 0 0
|
|
copytranslate p12 p0 40 0 0
|
|
copytranslate p21 p0 0 20 0
|
|
copytranslate p22 p0 40 20 0
|
|
copytranslate p31 p0 0 40 0
|
|
copytranslate p32 p0 40 40 0
|
|
compound p11 p12 p21 p22 p31 p32 ss
|
|
incmesh ss 1
|
|
vdefaults -autoTriang 0
|
|
|
|
# display objects
|
|
vdisplay -dispMode 1 p11 p12 p21 p22 p31 p32
|
|
vdrawparray p41 triangles v 0 55 0 v 0 75 0 v 20 55 0 v 0 55 0 v 0 75 0 v 0 55 20 v 0 55 0 v 0 55 20 v 20 55 0 v 0 75 0 v 0 55 20 v 20 55 0
|
|
vdrawparray p42 triangles v 40 55 0 v 40 75 0 v 60 55 0 v 40 55 0 v 40 75 0 v 40 55 20 v 40 55 0 v 40 55 20 v 60 55 0 v 40 75 0 v 40 55 20 v 60 55 0
|
|
vtop
|
|
vrotate -0.9 0.1 0
|
|
vfit
|
|
|
|
vcaps -ffp 1
|
|
vdump $::imagedir/${::casename}_defaults_ffp.png
|
|
|
|
vcaps -ffp 0
|
|
vdump $::imagedir/${::casename}_defaults.png
|
|
|
|
# customize shading models
|
|
vaspects p11 -setShadingModel VERTEX
|
|
vdrawtext t11 Graphic3d_TOSM_VERTEX -pos 10 5 10 -color RED -aspect BOLD
|
|
vaspects p12 -setShadingModel FRAGMENT
|
|
vdrawtext t12 Graphic3d_TOSM_FRAGMENT -pos 50 5 10 -color RED -aspect BOLD
|
|
|
|
vaspects p21 -setShadingModel PBR
|
|
vdrawtext t21 Graphic3d_TOSM_PBR -pos 10 25 10 -color RED -aspect BOLD
|
|
vaspects p22 -setShadingModel PBR_FACET
|
|
vdrawtext t22 Graphic3d_TOSM_PBR_FACET -pos 50 25 10 -color RED -aspect BOLD
|
|
|
|
vaspects p31 -setShadingModel UNLIT
|
|
vdrawtext t31 Graphic3d_TOSM_UNLIT -pos 10 45 10 -color RED -aspect BOLD
|
|
vaspects p32 -setShadingModel FACET
|
|
vdrawtext t32 Graphic3d_TOSM_FACET -pos 50 45 10 -color RED -aspect BOLD
|
|
vaspects p41 -setShadingModel VERTEX
|
|
vdrawtext t41 Graphic3d_TOSM_VERTEX -pos 10 65 10 -color RED -aspect BOLD
|
|
vaspects p42 -setShadingModel FACET
|
|
vdrawtext t42 Graphic3d_TOSM_FACET -pos 50 65 10 -color RED -aspect BOLD
|
|
vdisplay -topmost t11 t12 t21 t22 t31 t32 t41 t42
|
|
|
|
vcaps -ffp 1
|
|
vdump $::imagedir/${::casename}_ffp.png
|
|
|
|
vcaps -ffp 0
|
|
vlight -change 1 -intensity 0.1
|
|
vrenderparams -shadingModel pbr
|
|
vdump $::imagedir/${::casename}.png
|