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:
12
tests/opengl/data/background/bug1188
Normal file
12
tests/opengl/data/background/bug1188
Normal file
@@ -0,0 +1,12 @@
|
||||
puts "================"
|
||||
puts "0001188: Impossible to set background image for V3d_View"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
vbackground -image [locate_data_file OCC1188.gif]
|
||||
if { [vreadpixel 200 200 rgb name] != "WHITE" } { puts "Error: image background is not set" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
75
tests/opengl/data/background/bug21747
Normal file
75
tests/opengl/data/background/bug21747
Normal file
@@ -0,0 +1,75 @@
|
||||
puts "============"
|
||||
puts "OCC21747"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
puts "Type=NONE, Color from RED to BLUE"
|
||||
vbackground -gradient RED BLUE -gradientMode NONE
|
||||
vdump $imagedir/${casename}_none.png
|
||||
|
||||
puts "Type=HORIZONTAL, Color from RED to BLUE, Direction from LEFT to RIGHT"
|
||||
vbackground -gradient RED BLUE -gradientMode HORIZONTAL
|
||||
vdump $imagedir/${casename}_hor1.png
|
||||
|
||||
puts "Type=HORIZONTAL, Color from BLUE to RED, Direction from LEFT to RIGHT"
|
||||
vbackground -gradient BLUE RED -gradientMode HORIZONTAL
|
||||
vdump $imagedir/${casename}_hor2.png
|
||||
|
||||
puts "Type=VERTICAL, Color from RED to BLUE, Direction from TOP to BOTTOM"
|
||||
vbackground -gradient RED BLUE -gradientMode VERTICAL
|
||||
vdump $imagedir/${casename}_vert1.png
|
||||
|
||||
puts "Type=VERTICAL, Color from BLUE to RED, Direction from TOP to BOTTOM"
|
||||
vbackground -gradient BLUE RED -gradientMode VERTICAL
|
||||
vdump $imagedir/${casename}_vert2.png
|
||||
|
||||
puts "Type=DIAGONAL1, Color from RED to BLUE, Direction from LEFT TOP CORNER to RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode DIAGONAL1
|
||||
vdump $imagedir/${casename}_diag1.png
|
||||
|
||||
puts "Type=DIAGONAL1, Color from BLUE to RED, Direction from LEFT TOP CORNER to RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode DIAGONAL1
|
||||
vdump $imagedir/${casename}_diag2.png
|
||||
|
||||
puts "Type=DIAGONAL2, Color from RED to BLUE, Direction from RIGHT TOP CORNER to LEFT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode DIAGONAL2
|
||||
vdump $imagedir/${casename}_diag3.png
|
||||
|
||||
puts "Type=DIAGONAL2, Color from BLUE to RED, Direction from RIGHT TOP CORNER to LEFT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode DIAGONAL2
|
||||
vdump $imagedir/${casename}_diag4.png
|
||||
|
||||
puts "Type=CORNER1, Color from RED to BLUE, Direction from LEFT TOP CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER1
|
||||
vdump $imagedir/${casename}_corn1.png
|
||||
|
||||
puts "Type=CORNER2, Color from RED to BLUE, Direction from RIGHT TOP CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER2
|
||||
vdump $imagedir/${casename}_corn2.png
|
||||
|
||||
puts "Type=CORNER3, Color from RED to BLUE, Direction from RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER3
|
||||
vdump $imagedir/${casename}_corn3.png
|
||||
|
||||
puts "Type=CORNER4, Color from RED to BLUE, Direction from LEFT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER4
|
||||
vdump $imagedir/${casename}_corn4.png
|
||||
|
||||
puts "Type=CORNER1, Color from BLUE to RED, Direction from LEFT TOP CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER1
|
||||
vdump $imagedir/${casename}_corn5.png
|
||||
|
||||
puts "Type=CORNER2, Color from BLUE to RED, Direction from RIGHT TOP CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER2
|
||||
vdump $imagedir/${casename}_corn6.png
|
||||
|
||||
puts "Type=CORNER3, Color from BLUE to RED, Direction from RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER3
|
||||
vdump $imagedir/${casename}_corn7.png
|
||||
|
||||
puts "Type=CORNER4, Color from BLUE to RED, Direction from LEFT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER4
|
||||
vdump $imagedir/${casename}_corn8.png
|
28
tests/opengl/data/background/bug23102
Normal file
28
tests/opengl/data/background/bug23102
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "================"
|
||||
puts "OCC23102: Change the algorithm of rendering the 3d viewer background using tiled texture"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
vbackground -image [locate_data_file OCC23102.bmp] -imageMode TILED
|
||||
|
||||
set x1 58
|
||||
set y1 4
|
||||
set R_bg 0.70196002721786499
|
||||
set G_bg 0.78039199113845825
|
||||
set B_bg 0.86274499999999998
|
||||
|
||||
set WrongColor "$R_bg $G_bg $B_bg"
|
||||
|
||||
set Color [vreadpixel ${x1} ${y1} rgb]
|
||||
|
||||
# Resume
|
||||
puts ""
|
||||
if { "[vreadpixel ${x1} ${y1} rgb]" != "$WrongColor" } {
|
||||
puts "OK OCC23102"
|
||||
} else {
|
||||
puts "Faulty OCC23102"
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}.png
|
19
tests/opengl/data/background/bug23363
Normal file
19
tests/opengl/data/background/bug23363
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============"
|
||||
puts "0023363: Lost gradient background when switching to the hollow interior style"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vbackground -gradient FA0000 GREEN -gradientMode VERTICAL
|
||||
pcylinder p 100 200
|
||||
vdisplay -dispMode 1 p
|
||||
vaspects p -setInteriorStyle HOLLOW -setDrawEdges 1
|
||||
|
||||
set color1 [vreadpixel 10 0 rgb]
|
||||
set rd1 [lindex $color1 0]
|
||||
if { $rd1 == 0 } { puts "Faulty ${BugNumber}" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
24
tests/opengl/data/background/bug25475
Normal file
24
tests/opengl/data/background/bug25475
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "============"
|
||||
puts "0025475: Visualization, TKOpenGl - draw background using primitive arrays"
|
||||
puts "Tests textured background"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
set aTextureFile [locate_data_file hatch_1.png]
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
vbackground -image $aTextureFile -imageMode STRETCH
|
||||
vdump $imagedir/${casename}_1.png
|
||||
|
||||
vbackground -image $aTextureFile -imageMode NONE
|
||||
vbackground -image $aTextureFile -imageMode TILED
|
||||
vdump $imagedir/${casename}_2.png
|
||||
|
||||
vbackground -gradient RED BLUE -gradientMode HORIZONTAL
|
||||
vbackground -image $aTextureFile -imageMode CENTERED
|
||||
vdump $imagedir/${casename}_3.png
|
||||
|
||||
vbackground -image $aTextureFile -imageMode NONE
|
||||
vdump $imagedir/${casename}_4.png
|
16
tests/opengl/data/background/bug25775
Normal file
16
tests/opengl/data/background/bug25775
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0025775: Default Gradient Background in V3d_Viewer has no effect in new created V3d_View"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vbackground -default -gradient BLACK GRAY25 -gradientMode HORIZONTAL
|
||||
vinit View1 w=400 h=400
|
||||
if { [vreadpixel 399 100 -rgb -name] != "GRAY25" } { puts "Error: bug with default gradient color is reproduced." }
|
||||
|
||||
vinit View2 w=400 h=400
|
||||
if { [vreadpixel 399 100 -rgb -name] != "GRAY25" } { puts "Error: bug with default gradient color is reproduced." }
|
||||
|
||||
vbackground -default -color GRAY50
|
||||
vinit View3
|
||||
if { [vreadpixel 100 100 -rgb -name] != "GRAY50" } { puts "Error: bug with default background color is reproduced." }
|
22
tests/opengl/data/background/bug26599
Normal file
22
tests/opengl/data/background/bug26599
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "============"
|
||||
puts "CR26599: Visualization, TKOpenGl - gradient background should reset model transformation in Core profile"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vaxo
|
||||
|
||||
vbackground -gradient RED BLUE -gradientMode VERTICAL
|
||||
box b 1 2 3
|
||||
vdisplay b
|
||||
|
||||
vfit
|
||||
|
||||
vlocation b -rotate 0 0 0 0 0 1 50
|
||||
|
||||
vmoveto 380 50
|
||||
checkcolor 380 50 0.87450981140136719 0 0.12156862765550613
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
24
tests/opengl/data/background/bug27836
Normal file
24
tests/opengl/data/background/bug27836
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "========"
|
||||
puts "Gradient background is lost at some camera positions"
|
||||
puts "========"
|
||||
|
||||
# Test case setup the camera in such a position,
|
||||
# so that background plane will be clipped by Z-range if not handled by Z-fit.
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 0 0 -100 100 90 10
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vzbufftrihedron
|
||||
vdisplay -dispMode 1 b
|
||||
vsetlocation b 0 0 1000
|
||||
vfit
|
||||
|
||||
vviewparams -scale 6.66 -eye 48 43 -210 -at 50 45 -95
|
||||
|
||||
if { [vreadpixel 100 300 -rgb -name] != "GRAY75" } { puts "Error: gradient background is not displayed" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
43
tests/opengl/data/clipping/bug22906
Normal file
43
tests/opengl/data/clipping/bug22906
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC22906: Gradient background is clipped by planes"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
set BugNumber OCC22906
|
||||
set x1 73
|
||||
set y1 338
|
||||
|
||||
set x2 144
|
||||
set y2 23
|
||||
|
||||
set x3 377
|
||||
set y3 123
|
||||
|
||||
set x4 87
|
||||
set y4 232
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vbackground -gradient RED BLUE -gradientMode DIAGONAL2
|
||||
set Color1 [vreadpixel ${x1} ${y1} rgb]
|
||||
set Color2 [vreadpixel ${x2} ${y2} rgb]
|
||||
set Color3 [vreadpixel ${x3} ${y3} rgb]
|
||||
set Color4 [vreadpixel ${x4} ${y4} rgb]
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 1 0 0 -0.1
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
box b 100 100 100
|
||||
vdisplay b
|
||||
vsetdispmode 1
|
||||
set ColorRes1 [vreadpixel ${x1} ${y1} rgb]
|
||||
set ColorRes2 [vreadpixel ${x2} ${y2} rgb]
|
||||
set ColorRes3 [vreadpixel ${x3} ${y3} rgb]
|
||||
set ColorRes4 [vreadpixel ${x4} ${y4} rgb]
|
||||
|
||||
if { ${Color1} == ${ColorRes1} && ${Color2} == ${ColorRes2} && ${Color3} == ${ColorRes3} && ${Color4} == ${ColorRes4}} {
|
||||
puts "OK ${BugNumber}"
|
||||
} else {
|
||||
puts "Faulty ${BugNumber}"
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}.png
|
21
tests/opengl/data/clipping/bug23484_2
Normal file
21
tests/opengl/data/clipping/bug23484_2
Normal file
@@ -0,0 +1,21 @@
|
||||
puts "============"
|
||||
puts "OCC23484: Visualization, TKOpenGl - primitive arrays to become the only way to render geometry"
|
||||
puts "Tests clipping plane rendering with primitive arrays"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
box b 1 1 1
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
vclipplane create pln
|
||||
vclipplane set pln view Driver1/Viewer1/View1
|
||||
vclipplane change pln equation 0 1 0 -0.5
|
||||
vclipplane change pln capping on
|
||||
|
||||
vdump $imagedir/${casename}_1.png
|
51
tests/opengl/data/clipping/bug24224
Normal file
51
tests/opengl/data/clipping/bug24224
Normal file
@@ -0,0 +1,51 @@
|
||||
puts "==========="
|
||||
puts "OCC24224: Suspicious logics in changing clipping planets at OpenGL_Structure"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
## centre rectangle
|
||||
set x1_coord 150
|
||||
set y1_coord 250
|
||||
|
||||
## right rectangle
|
||||
set x2_coord 255
|
||||
set y2_coord 320
|
||||
|
||||
## left rectangle
|
||||
set x3_coord 73
|
||||
set y3_coord 150
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
box b1 0 0 0 10 10 10
|
||||
box b2 30 0 0 10 40 10
|
||||
box b3 -30 0 0 20 20 20
|
||||
vsetdispmode 1
|
||||
vdisplay b1 b2 b3
|
||||
vfit
|
||||
|
||||
## test view-level clipping
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 0 1 0 -5
|
||||
vclipplane change pln1 capping on
|
||||
vclipplane change pln1 capping color 0.9 0.9 0.9
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
|
||||
checkcolor $x1_coord $y1_coord 0.9 0.9 0.9
|
||||
checkcolor $x2_coord $y2_coord 0.9 0.9 0.9
|
||||
|
||||
## test sharing of planes between view and object
|
||||
vclipplane set pln1 object b1
|
||||
|
||||
## test object-level clipping
|
||||
vclipplane create pln2
|
||||
vclipplane change pln2 equation -0.707 0.707 0 -25
|
||||
vclipplane change pln2 capping on
|
||||
vclipplane change pln2 capping color 0.5 0.5 0.9
|
||||
vclipplane change pln2 capping hatch on
|
||||
vclipplane set pln2 object b3
|
||||
|
||||
checkcolor $x3_coord $y3_coord 0.5 0.5 0.9
|
||||
|
||||
vdump $imagedir/${casename}.png
|
16
tests/opengl/data/clipping/bug24522
Normal file
16
tests/opengl/data/clipping/bug24522
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "OCC24522: Application crashes on view closing in case of using of clipping planes"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 1 1 1
|
||||
vdisplay b
|
||||
vfit
|
||||
vsetdispmode b 1
|
||||
vclipplane create p
|
||||
vclipplane change p equation 0 0 -1 -0.5
|
||||
vclipplane set p view Driver1/Viewer1/View1
|
||||
vclipplane change p capping on
|
||||
vclipplane unset p view Driver1/Viewer1/View1
|
||||
vclose View1
|
23
tests/opengl/data/clipping/bug24717
Normal file
23
tests/opengl/data/clipping/bug24717
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "OCC24717: TKOpenGl - globally defined clipping planes blink when operating with view"
|
||||
puts "Test checks that state of clippings always corresponds to a state of viewed scene."
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
box b 1 1 1
|
||||
vdisplay b
|
||||
vmoveto 204 204
|
||||
vclipplane create pln1
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
vclipplane change pln1 equation 0 1 0 0
|
||||
vfit
|
||||
vaspects -setwidth 5
|
||||
|
||||
if { "[vreadpixel 204 204 rgb name]" != "CYAN" } {
|
||||
puts "Error : Viewer clipping is broken."
|
||||
}
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
23
tests/opengl/data/clipping/bug24901
Normal file
23
tests/opengl/data/clipping/bug24901
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "CR24901: Visualization - Incorrect area filled with capping color"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
box b 10 10 10
|
||||
vdisplay b
|
||||
vsetdispmode 1
|
||||
|
||||
vclipplane create pln1
|
||||
vclipplane set pln1 object b
|
||||
vclipplane change pln1 equation 0 1 0 -5
|
||||
vclipplane change pln1 capping on
|
||||
vfit
|
||||
vmoveto 304 146
|
||||
|
||||
if { "[vreadpixel 304 146 rgb name]" != "CYAN" } {
|
||||
puts "Error : Highlighting is broken."
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}.png
|
30
tests/opengl/data/clipping/bug24902_1
Normal file
30
tests/opengl/data/clipping/bug24902_1
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "==========="
|
||||
puts "OCC24902: Visualization - advanced processing of compounds containing solids and other shape types"
|
||||
puts "Tests capping on solid, shell and unclosed compound"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
box b 0 0 0 10 10 10
|
||||
box b_shell 15 0 0 10 10 10
|
||||
box b_solid 30 0 0 10 10 10
|
||||
explode b F
|
||||
explode b_shell Sh
|
||||
|
||||
# Put shell and solid into compound
|
||||
compound b_1 b_2 b_3 b_4 b_6 b_comp
|
||||
vdisplay b_comp b_shell_1 b_solid
|
||||
vsetdispmode 1
|
||||
vfit
|
||||
|
||||
# set clipping plane
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 0 2 -1 -1
|
||||
vclipplane change pln1 capping on
|
||||
vclipplane change pln1 capping color 0.9 0.9 0.9
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
|
||||
vrotate 0 0.2 0
|
||||
|
||||
vdump $imagedir/${casename}.png
|
29
tests/opengl/data/clipping/bug24902_2
Normal file
29
tests/opengl/data/clipping/bug24902_2
Normal file
@@ -0,0 +1,29 @@
|
||||
puts "==========="
|
||||
puts "OCC24902: Visualization - advanced processing of compounds containing solids and other shape types"
|
||||
puts "Tests the capping on compound that contains shell and solid"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
box b 0 0 0 10 10 10
|
||||
box b_solid 20 0 0 10 10 10
|
||||
explode b F
|
||||
|
||||
# Put shell and solid into compound
|
||||
compound b_1 b_2 b_3 b_4 b_6 b_shell
|
||||
compound b_shell b_solid comp
|
||||
vdisplay comp
|
||||
vsetdispmode 1
|
||||
vfit
|
||||
|
||||
# set clipping plane
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 0 1 0 -5
|
||||
vclipplane change pln1 capping on
|
||||
vclipplane change pln1 capping color 0.9 0.9 0.9
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
|
||||
vrotate 0 0.2 0
|
||||
|
||||
vdump $imagedir/${casename}.png
|
47
tests/opengl/data/clipping/bug25052
Normal file
47
tests/opengl/data/clipping/bug25052
Normal file
@@ -0,0 +1,47 @@
|
||||
puts "REQUIRED All: Error: clipping planes limit"
|
||||
puts "==========="
|
||||
puts "OCC25052: Visualization - activation of all Clipping Planes within driver limit leads to broken planes management"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
set Image1 ${imagedir}/${casename}_1.png
|
||||
set Image9 ${imagedir}/${casename}_9.png
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b -30 -30 -30 70 80 90
|
||||
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
vclipplane create p1
|
||||
vclipplane change p1 equation 1 0 0 -0.1
|
||||
vclipplane create p2
|
||||
vclipplane change p2 equation 1 0 0 -0.1
|
||||
vclipplane create p3
|
||||
vclipplane change p3 equation 1 0 0 -0.1
|
||||
vclipplane create p4
|
||||
vclipplane change p4 equation 1 0 0 -0.1
|
||||
vclipplane create p5
|
||||
vclipplane change p5 equation 1 0 0 -0.1
|
||||
vclipplane create p6
|
||||
vclipplane change p6 equation 1 0 0 -0.1
|
||||
vclipplane create p7
|
||||
vclipplane change p7 equation 1 0 0 -0.1
|
||||
vclipplane create p8
|
||||
vclipplane change p8 equation 1 0 0 -0.1
|
||||
vclipplane create p9
|
||||
vclipplane change p9 equation 1 0 0 -0.1
|
||||
|
||||
vclipplane set p1 view Driver1/Viewer1/View1
|
||||
vdump ${Image1}
|
||||
vclipplane set p2 view Driver1/Viewer1/View1
|
||||
vclipplane set p3 view Driver1/Viewer1/View1
|
||||
vclipplane set p4 view Driver1/Viewer1/View1
|
||||
vclipplane set p5 view Driver1/Viewer1/View1
|
||||
vclipplane set p6 view Driver1/Viewer1/View1
|
||||
vclipplane set p7 view Driver1/Viewer1/View1
|
||||
vclipplane set p8 view Driver1/Viewer1/View1
|
||||
vclipplane set p9 view Driver1/Viewer1/View1
|
||||
vdump ${Image9}
|
21
tests/opengl/data/clipping/bug25060
Normal file
21
tests/opengl/data/clipping/bug25060
Normal file
@@ -0,0 +1,21 @@
|
||||
puts "============"
|
||||
puts "CR25060: Capping breaks highlighting of shaded AIS_Shape with displayed edges."
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
box b 10 10 10
|
||||
vdisplay b
|
||||
vaspects b -setFaceBoundaryDraw 1
|
||||
vclipplane create pln1
|
||||
vclipplane set pln1 object b
|
||||
vclipplane change pln1 equation 0 1 0 -5
|
||||
vclipplane change pln1 capping on
|
||||
vsetdispmode 1
|
||||
vfit
|
||||
vmoveto 304 146
|
||||
checkcolor 304 146 0 1 1
|
||||
if { $stat != 1 } { puts "Error : Highlighting is broken." }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
32
tests/opengl/data/clipping/bug25132
Normal file
32
tests/opengl/data/clipping/bug25132
Normal file
@@ -0,0 +1,32 @@
|
||||
puts "============"
|
||||
puts "OCC25132: Visualization - Capping algorithm not working sometimes"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 0 1 0 0
|
||||
vclipplane change pln1 capping on
|
||||
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||
|
||||
# Capping should be enabled for the solid with a bounding shell with Closed flag not set
|
||||
restore [locate_data_file OCC25132-flight_solid.brep] fs
|
||||
vdisplay fs
|
||||
vfit
|
||||
vdump $imagedir/${casename}_flight_solid.png
|
||||
vremove fs
|
||||
|
||||
# Capping should be enabled for the solid with cavities
|
||||
restore [locate_data_file OCC25132-solid_with_cavities.brep] sc
|
||||
vdisplay sc
|
||||
vfit
|
||||
vdump $imagedir/${casename}_solid_with_cavities.png
|
||||
vremove sc
|
||||
|
||||
# Capping should display a non-manifold solid with an internal open shell correctly
|
||||
restore [locate_data_file OCC25132-Partition_1.brep] p1
|
||||
vdisplay p1
|
||||
vfit
|
||||
vdump $imagedir/${casename}_Partition_1.png
|
22
tests/opengl/data/clipping/bug25229
Normal file
22
tests/opengl/data/clipping/bug25229
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "============"
|
||||
puts "CR25229: Cappings have gray tint if setting color with vclipplane command."
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 100 100 100
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vdisplay b
|
||||
vclipplane create pln1
|
||||
vclipplane change pln1 equation 0 0 -1 20
|
||||
vclipplane set pln1 object b
|
||||
vclipplane change pln1 capping on
|
||||
vclipplane change pln1 capping color 1.0 1.0 1.0
|
||||
vtop
|
||||
vfit
|
||||
|
||||
checkcolor 100 100 1 1 1
|
||||
if { $stat != 1 } { puts "Error : Capping color is broken." }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
31
tests/opengl/data/clipping/bug25778
Normal file
31
tests/opengl/data/clipping/bug25778
Normal file
@@ -0,0 +1,31 @@
|
||||
puts "================================================================"
|
||||
puts "CR25778"
|
||||
puts "Gradient background will cut view if there is ClipPlane defined."
|
||||
puts "================================================================"
|
||||
puts ""
|
||||
|
||||
set aExpectedImg $imagedir/${casename}_expected_img.png
|
||||
set aVerifiedImg $imagedir/${casename}_verified_img.png
|
||||
set aDiff $imagedir/${casename}_diff.png
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
box b 1 1 1
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
vclipplane create pln
|
||||
vclipplane set pln view Driver1/Viewer1/View1
|
||||
vclipplane change pln equation 0 1 0 -0.5
|
||||
|
||||
vbackground -gradient BLACK BLACK -gradientMode NONE
|
||||
vdump $aExpectedImg
|
||||
|
||||
vbackground -gradient BLACK BLACK -gradientMode HORIZONTAL
|
||||
vdump $aVerifiedImg
|
||||
|
||||
set aDiffRes [diffimage $aExpectedImg $aVerifiedImg 0.1 0 0 $aDiff]
|
||||
if {$aDiffRes != 0} { puts "ERROR : Test failed: gradient background affects clipping." }
|
28
tests/opengl/data/clipping/bug26940
Normal file
28
tests/opengl/data/clipping/bug26940
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "============"
|
||||
puts "0026940: Visualization, TKOpenGl - capping plane should be applied to connected structures"
|
||||
puts "Tests capping plane rendering with connected structures"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
box b 1 1 1
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
vclipplane pln -set Driver1/Viewer1/View1 -equation 0 1 0 -0.5 -capping on
|
||||
|
||||
vdump $imagedir/${casename}_normal.png
|
||||
set aColorNorm [vreadpixel 200 250 rgb name]
|
||||
if { "$aColorNorm" != "GRAY14" } { puts "Error: Expected color of capping plane is GRAY14 (normal presentation). Actual is $aColorNorm" }
|
||||
|
||||
vclear
|
||||
|
||||
vconnectto bb 0 0 0 b
|
||||
vdump $imagedir/${casename}_connected.png
|
||||
set aColorConn [vreadpixel 200 250 rgb name]
|
||||
|
||||
if { "$aColorConn" != "GRAY14" } { puts "Error: Expected color of capping plane is GRAY14 (connected presentation). Actual is $aColorConn" }
|
76
tests/opengl/data/clipping/bug27751_capping
Normal file
76
tests/opengl/data/clipping/bug27751_capping
Normal file
@@ -0,0 +1,76 @@
|
||||
puts "========"
|
||||
puts "Capping plane preserving material"
|
||||
puts "========"
|
||||
|
||||
set aHatch [locate_data_file images/hatch_1.png]
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
puts "Create the geometry"
|
||||
box b0sole 10 10 0 30 30 70
|
||||
box b0hole 20 20 -10 10 10 90
|
||||
bcut b0 b0sole b0hole
|
||||
box b1 40 20 0 10 30 70
|
||||
box b2 20 40 0 20 10 70
|
||||
box b3 0 40 0 20 10 70
|
||||
box b4 0 10 0 10 30 70
|
||||
box b5 0 0 0 30 10 70
|
||||
|
||||
set aNbParts 6
|
||||
set aColors { RED YELLOW GREEN GRAY MAGENTA ORANGE }
|
||||
|
||||
compound b0 b1 b2 b3 b4 b5 cc
|
||||
|
||||
puts "Create the viewer"
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit name=View1 w=512 h=512
|
||||
|
||||
vpoint p0 0 0 0
|
||||
vzbufftrihedron
|
||||
|
||||
puts "Display the geometry as dedicated objects"
|
||||
for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
|
||||
vdisplay -noupdate -dispMode 1 b${aPartIter}
|
||||
set aColor [lindex $aColors $aPartIter]
|
||||
vsetcolor -noupdate b${aPartIter} $aColor
|
||||
}
|
||||
|
||||
puts "Display the geometry as sole object"
|
||||
vdisplay -noupdate -dispMode 1 cc
|
||||
for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
|
||||
set aColor [lindex $aColors $aPartIter]
|
||||
vaspects -noupdate cc -subShapes b${aPartIter} -setColor $aColor
|
||||
}
|
||||
# show also connected interactive object
|
||||
vconnectto co -70 0 0 cc
|
||||
vsetdispmode co 1
|
||||
vsetlocation cc 70 0 0
|
||||
vfit
|
||||
|
||||
|
||||
set aPln1Z 40
|
||||
set aPln2Y 15
|
||||
|
||||
vpoint p1 0 0 1
|
||||
vpoint p2 1 0 1
|
||||
vpoint p3 0 1 1
|
||||
vplane pp1 p1 p2 p3
|
||||
vsetlocation -noupdate pp1 25 0 [expr $aPln1Z - 1]
|
||||
vremove -noupdate p1 p2 p3
|
||||
|
||||
vpoint p1 0 1 0
|
||||
vpoint p2 1 1 0
|
||||
vpoint p3 0 1 1
|
||||
vplane pp2 p1 p2 p3
|
||||
vsetlocation -noupdate pp2 25 $aPln2Y 35
|
||||
vremove -noupdate p1 p2 p3
|
||||
verase pp1 pp2
|
||||
vfit
|
||||
vdisplay pp1 pp2
|
||||
vzoom 0.8
|
||||
|
||||
puts "Enable capping planes"
|
||||
vclipplane pln1 -set -equation 0 0 -1 $aPln1Z -capping 1 -color 0.5 0.5 0.5 -texname $aHatch -texscale 0.02 -0.02 -useObjMaterial 1
|
||||
vclipplane pln2 -set -equation 0 1 0 [expr -$aPln2Y] -capping 1 -color 0.8 0.8 0.9 -texname $aHatch -texscale 0.02 -0.02
|
||||
vdump $imagedir/${casename}.png
|
72
tests/opengl/data/clipping/bug27945
Normal file
72
tests/opengl/data/clipping/bug27945
Normal file
@@ -0,0 +1,72 @@
|
||||
puts "==========="
|
||||
puts "OCC27945"
|
||||
puts "Visualization - handle correctly view clipping planes within zoom-persistent objects"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
box b 3 1 2
|
||||
box z000 50 40 30
|
||||
box z010 50 40 30
|
||||
box z002 50 40 30
|
||||
box z012 50 40 30
|
||||
box z300 50 40 30
|
||||
box z302 50 40 30
|
||||
box z310 50 40 30
|
||||
box z312 50 40 30
|
||||
box r1 0.2 0.1 0.1
|
||||
box r2 0.2 0.1 0.1
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vzbufftrihedron
|
||||
vdisplay -dispMode 1 b
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 0 0 0 z000
|
||||
vsetlocation z000 -25 -20 -15
|
||||
vdrawtext t000 "000\n" -pos 0 0 0 -color RED -halign right
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 0 1 0 z010
|
||||
vsetlocation z010 -25 -20 -15
|
||||
vdrawtext t010 "010\n" -pos 0 1 0 -color RED -halign right
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 0 0 2 z002
|
||||
vsetlocation z002 -25 -20 -15
|
||||
vdrawtext t002 "002\n" -pos 0 0 2 -color RED -halign right
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 0 1 2 z012
|
||||
vsetlocation z012 -25 -20 -15
|
||||
vdrawtext t012 "012\n" -pos 0 1 2 -color RED -halign right
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 3 0 0 z300
|
||||
vsetlocation z300 -25 -20 -15
|
||||
vdrawtext t300 "300\n" -pos 3 0 0 -color RED -halign left
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 3 0 2 z302
|
||||
vsetlocation z302 -25 -20 -15
|
||||
vdrawtext t302 "302\n" -pos 3 0 2 -color RED -halign left
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 3 1 0 z310
|
||||
vsetlocation z310 -25 -20 -15
|
||||
vdrawtext t310 "310\n" -pos 3 1 0 -color RED -halign left
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers zoom -trsfPersPos 3 1 2 z312
|
||||
vsetlocation z312 -25 -20 -15
|
||||
vdrawtext t312 "312\n" -pos 3 1 2 -color RED -halign left
|
||||
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers rotate -trsfPersPos -1 1 2 r1
|
||||
vdisplay -noupdate -dispMode 1 -trsfPers rotate -trsfPersPos 4 1 2 r2
|
||||
|
||||
vfit
|
||||
vrotate 0.1 0 0
|
||||
|
||||
vclipplane pln -equation -1 0 0 2 -set
|
||||
|
||||
set aColor1 [vreadpixel 320 160 rgb name]
|
||||
set aColor2 [vreadpixel 80 250 rgb name]
|
||||
if { "$aColor1" != "BLACK" } { puts "Error: zoom-persistent object is not clipped" }
|
||||
if { "$aColor2" != "DARKGOLDENROD" } { puts "Error: zoom-persistent object is clipped" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
24
tests/opengl/data/clipping/bug29768
Normal file
24
tests/opengl/data/clipping/bug29768
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "============"
|
||||
puts "0029768: Visualization, TKOpenGl - structure is entirely clipped by suppressed clipping"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vpoint p0 0 0 0
|
||||
vzbufftrihedron
|
||||
box b0 0 0 0 1 1 1
|
||||
box b1 3 0 0 1 1 1
|
||||
vdisplay -dispMode 1 b0 b1
|
||||
vsetcolor b0 RED
|
||||
vsetcolor b1 GREEN
|
||||
vfit
|
||||
|
||||
vclipplane pv equation -1 0 0 0.5 -set
|
||||
vclipplane pb0 equation 0 1 0 -0.5 -set b0
|
||||
vclipplane pb1 equation 0 1 0 -0.5 -setOverrideGlobal b1
|
||||
|
||||
if { [vreadpixel 300 200 rgb name] != "GREEN2" } { puts "Error: box b1 is fully clipped" }
|
||||
vdump $imagedir/${casename}.png
|
23
tests/opengl/data/clipping/bug29874
Normal file
23
tests/opengl/data/clipping/bug29874
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "0029874: Visualization - capping plane transparency does not work"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b1 -30 0 30 20 20 20
|
||||
box b2 -30 0 0 20 20 20
|
||||
box b3 -30 0 -30 20 20 20
|
||||
box b4 -30 0 -60 20 20 20
|
||||
vclear
|
||||
vinit View1
|
||||
vzbufftrihedron
|
||||
vdisplay -dispMode 1 b1 b2 b3 b4
|
||||
vviewparams -scale 12.7 -proj 0.6 -0.16 0.79 -up -0.65 0.5 0.58 -at -24 12.4 -1.1
|
||||
vaspects b1 b4 -setTransparency 0.5
|
||||
vaspects b2 -setColor RED
|
||||
vaspects b3 -setColor GREEN
|
||||
|
||||
vclipplane pln1 -set b1 b2 -equation -0.707 0.707 0 -25 -capping on -useObjMaterial 1
|
||||
vclipplane pln2 -set b3 b4 -equation -0.707 0.707 0 -25 -capping on -color 0.5 0.5 0.9 -transparency 0.2
|
||||
|
||||
vdump $imagedir/${casename}.png
|
19
tests/opengl/data/clipping/bug30756
Normal file
19
tests/opengl/data/clipping/bug30756
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============="
|
||||
puts "0030756: Visualization, TKOpenGl - capping plane does not work for ZLayer with non-zero origin"
|
||||
puts "============="
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 1 2 3
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vzbufftrihedron
|
||||
vaxo
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vclipplane p 1 -equation 0 1 0 -1 -set -capping 1
|
||||
if { [vreadpixel 200 200 rgb name] != "GRAY14" } { puts "Error: capping does not work with zero origin" }
|
||||
vzlayer DEFAULT -origin 0 10 0
|
||||
if { [vreadpixel 200 200 rgb name] != "GRAY14" } { puts "Error: capping does not work with non-zero origin" }
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
95
tests/opengl/data/clipping/clipping1
Normal file
95
tests/opengl/data/clipping/clipping1
Normal file
@@ -0,0 +1,95 @@
|
||||
puts "========"
|
||||
puts "0029729: Visualization, Graphic3d_ClipPlane - add support of clipping plane chains"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
|
||||
set aCapParams "-capping 1 -color 0.5 0.5 0.5 -texname [locate_data_file images/hatch_1.png] -texscale 0.02 -0.02 -useObjMaterial 1"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create the geometry
|
||||
box b0sole 10 10 0 30 30 70
|
||||
box b0hole 20 20 -10 10 10 90
|
||||
bcut b0 b0sole b0hole
|
||||
box b1 40 20 0 10 30 70
|
||||
box b2 20 40 0 20 10 70
|
||||
box b3 0 40 0 20 10 70
|
||||
box b4 0 10 0 10 30 70
|
||||
box b5 0 0 0 30 10 70
|
||||
box bb 10 -10 0 20 10 10
|
||||
|
||||
set aNbParts 6
|
||||
set aColors { RED YELLOW GREEN GRAY MAGENTA ORANGE }
|
||||
|
||||
compound b0 b1 b2 b3 b4 b5 cc
|
||||
|
||||
# create the viewer
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit name=View1 w=512 h=512
|
||||
vviewparams -scale 4.66737 -proj 0.465292 -0.577133 0.671134 -up -0.46873 0.482524 0.739907 -at 15.807 37.1157 21.9799
|
||||
|
||||
vpoint p0 0 0 0
|
||||
vdisplay -dispMode 1 bb
|
||||
vaspects -noupdate bb -setColor CYAN
|
||||
vzbufftrihedron
|
||||
|
||||
puts "Display the geometry as dedicated objects"
|
||||
for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
|
||||
vdisplay -noupdate -dispMode 1 b${aPartIter}
|
||||
set aColor [lindex $aColors $aPartIter]
|
||||
vsetcolor -noupdate b${aPartIter} $aColor
|
||||
}
|
||||
|
||||
puts "Display the geometry as sole object"
|
||||
vdisplay -noupdate -dispMode 1 cc
|
||||
for { set aPartIter 0 } { $aPartIter < $aNbParts } { incr aPartIter } {
|
||||
set aColor [lindex $aColors $aPartIter]
|
||||
vaspects -noupdate cc -subShapes b${aPartIter} -setColor $aColor
|
||||
}
|
||||
# show also connected interactive object
|
||||
vconnectto co -70 0 0 cc
|
||||
vsetdispmode co 1
|
||||
vsetlocation cc 70 0 0
|
||||
|
||||
set aPln1Z 40
|
||||
set aPln2Y 15
|
||||
|
||||
vpoint p1 0 0 1
|
||||
vpoint p2 1 0 1
|
||||
vpoint p3 0 1 1
|
||||
vplane pp1 p1 p2 p3
|
||||
vsetlocation -noupdate pp1 25 0 [expr $aPln1Z - 1]
|
||||
vremove -noupdate p1 p2 p3
|
||||
|
||||
vpoint p1 0 1 0
|
||||
vpoint p2 1 1 0
|
||||
vpoint p3 0 1 1
|
||||
vplane pp2 p1 p2 p3
|
||||
vsetlocation -noupdate pp2 25 $aPln2Y 35
|
||||
vremove -noupdate p1 p2 p3
|
||||
verase pp1 pp2
|
||||
vfit
|
||||
vdisplay pp1 pp2
|
||||
|
||||
vclipplane pln -set {*}$aCapParams -equation1 0 0 -1 40 -equation2 0 1 0 -15
|
||||
if { [vreadpixel 200 360 rgb name] != "CYAN2" } { puts "Error: bb should NOT be clipped" }
|
||||
vdump $::imagedir/${::casename}_2.png
|
||||
|
||||
vclipplane pln -set {*}$aCapParams -equation1 0 0 -1 40 -equation2 0 1 0 -15 -equation3 -1 0 0 5
|
||||
vdump $::imagedir/${::casename}_3.png
|
||||
|
||||
vsettransparency b0 b1 b2 b3 b4 b5 0.5
|
||||
vdump $::imagedir/${::casename}_3transp.png
|
||||
|
||||
vviewparams -scale 8.51584 -proj 0.284186 0.750426 0.59674 -up -0.228109 -0.55161 0.802305 -at 24.2647 23.8116 32.8743
|
||||
vclipplane pln -set {*}$aCapParams -boxint 25 25 25 55 55 55
|
||||
vsettransparency b0 b1 b2 b3 b4 b5 0
|
||||
vdump $::imagedir/${::casename}_6.png
|
||||
|
||||
vsettransparency b0 b1 b2 b3 b4 b5 0.5
|
||||
vdump $::imagedir/${::casename}_6transp.png
|
17
tests/opengl/data/general/bndbox1
Normal file
17
tests/opengl/data/general/bndbox1
Normal file
@@ -0,0 +1,17 @@
|
||||
puts "============"
|
||||
puts "0029823: Visualization, TKOpenGl - highlighting by Bounding Box mistreats Local Transformation"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
psphere s0 1
|
||||
psphere s1 1
|
||||
vdisplay -dispMode 1 s0 s1
|
||||
vlocation s1 -reset -rotate 0 0 0 1 0 0 20 -translate 2 1 0
|
||||
vfit
|
||||
vbounding
|
||||
|
||||
vdump $imagedir/${casename}.png
|
33
tests/opengl/data/general/bug25679
Normal file
33
tests/opengl/data/general/bug25679
Normal file
@@ -0,0 +1,33 @@
|
||||
puts "========"
|
||||
puts "OCC25679: Visualization, TKOpenGl - View frustum culling clips wrong objects"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set LINES_IN_ROW 50
|
||||
|
||||
set aNoCulling $imagedir/${casename}_without.png
|
||||
set aWithCulling $imagedir/${casename}_with.png
|
||||
set aDiff $imagedir/${casename}_diff.png
|
||||
|
||||
vinit View1
|
||||
|
||||
for {set i 0} {$i < $LINES_IN_ROW} {incr i} {
|
||||
for {set j 0} {$j < $LINES_IN_ROW} {incr j} {
|
||||
set aLineName "line"
|
||||
append aLineName [expr $i * $LINES_IN_ROW + $j]
|
||||
vline $aLineName 0 0 0 1 0 0
|
||||
vsetlocation $aLineName [expr $i * 3] [expr $j * 3] 0
|
||||
}
|
||||
}
|
||||
|
||||
vfit
|
||||
|
||||
vrenderparams -frustumculling on
|
||||
vdump $aWithCulling
|
||||
vrenderparams -frustumculling off
|
||||
vdump $aNoCulling
|
||||
|
||||
set aDiffRes [diffimage $aWithCulling $aNoCulling 0.1 0 0 $aDiff]
|
||||
if {$aDiffRes != 0} { puts "ERROR : Test failed: there is a difference between images rendered with and without frustum culling" }
|
34
tests/opengl/data/general/culldist
Normal file
34
tests/opengl/data/general/culldist
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "0029295: Visualization, TKOpenGl - provide distance culling option"
|
||||
puts "Check distance culling"
|
||||
puts "========"
|
||||
|
||||
set THE_NB_BOXES 5
|
||||
set THE_COLORS { RED GREEN BLUE YELLOW PURPLE1 }
|
||||
set THE_PICK_PNTS1 { { 20 80 } { 60 110 } { 120 140 } { 200 180 } { 300 240 } }
|
||||
set THE_PICK_PNTS2 { { 110 140 } { 130 150 } { 160 170 } { 200 190 } { 240 210 } }
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vcamera -persp
|
||||
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { box b$x $x 0 0 0.5 0.2 0.4; vpoint p$x $x 0 0; vdisplay -mutable p$x; vdisplay -dispMode 1 b$x }
|
||||
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { vsetcolor b$x [lindex $THE_COLORS $x] }
|
||||
vline l 0 0 0 5 0 0
|
||||
vdisplay -mutable l
|
||||
vfit
|
||||
vzlayer default -culldist 7
|
||||
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
|
||||
vdump $::imagedir/${::casename}_7.png
|
||||
|
||||
vzlayer default -culldist 5
|
||||
for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
|
||||
for { set x 0 } { $x < 2 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1 $x] rgb name] != "BLACK" } { puts "Error: object is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_5.png
|
||||
|
||||
vzoom 0.5
|
||||
vzlayer default -culldist 10
|
||||
for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2 $x] rgb name] == "BLACK" } { puts "Error: object is culled" } }
|
||||
for { set x 0 } { $x < 1 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2 $x] rgb name] != "BLACK" } { puts "Error: object is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_10.png
|
57
tests/opengl/data/general/cullsize
Normal file
57
tests/opengl/data/general/cullsize
Normal file
@@ -0,0 +1,57 @@
|
||||
puts "========"
|
||||
puts "0029295: Visualization, TKOpenGl - provide distance culling option"
|
||||
puts "Check size culling"
|
||||
puts "========"
|
||||
|
||||
set THE_NB_BOXES 5
|
||||
set THE_COLORS { RED GREEN BLUE YELLOW PURPLE1 }
|
||||
set THE_PICK_PNTS1O { { 10 165 } { 100 200 } { 170 250 } { 250 250 } { 350 300 } }
|
||||
set THE_PICK_PNTS1P { { 40 170 } { 100 200 } { 170 250 } { 250 250 } { 380 350 } }
|
||||
set THE_PICK_PNTS2O { { 148 192 } { 175 200 } { 190 200 } { 200 220 } { 250 230 } }
|
||||
set THE_PICK_PNTS2P { { 152 192 } { 175 200 } { 190 200 } { 220 220 } { 250 230 } }
|
||||
set THE_PICK_PNTS3P { { 90 155 } { 105 160 } { 125 170 } { 140 175 } { 160 180 } }
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
for { set x 1 } { $x <= $THE_NB_BOXES } { incr x } { box b$x [expr $x * 1.0] 0 0 [expr $x * 0.2] [expr $x *0.1] [expr $x *0.3]; vdisplay -dispMode 1 b$x }
|
||||
for { set x 1 } { $x <= $THE_NB_BOXES } { incr x } { vsetcolor b$x [lindex $THE_COLORS [expr $x - 1]] }
|
||||
vline l 1 0 0 6 0 0
|
||||
vdisplay -mutable l
|
||||
vcamera -ortho
|
||||
vfit
|
||||
|
||||
vzlayer default -cullsize 25
|
||||
vcamera -ortho
|
||||
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
vdump $::imagedir/${::casename}_25o.png
|
||||
vcamera -persp
|
||||
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
vdump $::imagedir/${::casename}_25p.png
|
||||
|
||||
vzlayer default -cullsize 50
|
||||
vcamera -ortho
|
||||
for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
for { set x 0 } { $x < 1 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1O $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_50o.png
|
||||
vcamera -persp
|
||||
for { set x 1 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
for { set x 0 } { $x < 1 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS1P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_50p.png
|
||||
|
||||
vzoom 0.25
|
||||
vzlayer default -cullsize 30
|
||||
vcamera -ortho
|
||||
for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2O $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
for { set x 0 } { $x < 2 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2O $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_30o.png
|
||||
vcamera -persp
|
||||
for { set x 2 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
for { set x 0 } { $x < 2 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS2P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_30p.png
|
||||
|
||||
vviewparams -eye 16.8333 -9.08333 10.0833 -at 7.5 0.25 0.75
|
||||
for { set x 3 } { $x < $THE_NB_BOXES } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS3P $x] rgb name] == "BLACK" } { puts "Error: object $x is culled" } }
|
||||
for { set x 0 } { $x < 3 } { incr x } { if { [vreadpixel {*}[lindex $THE_PICK_PNTS3P $x] rgb name] != "BLACK" } { puts "Error: object $x is NOT culled" } }
|
||||
vdump $::imagedir/${::casename}_30p2.png
|
28
tests/opengl/data/general/depthprepass
Normal file
28
tests/opengl/data/general/depthprepass
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "========"
|
||||
puts "0029300: Visualization, TKOpenGl - provide depth pre-pass option"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
|
||||
# display objects
|
||||
psphere s 1
|
||||
box b 1 2 3
|
||||
vaxo
|
||||
vdisplay -dispMode 1 s b
|
||||
vaspects b -setColor RED -setTransparency 0.5
|
||||
vfit
|
||||
vzbufftrihedron
|
||||
vmoveto 150 250
|
||||
vcaps -ffp 0
|
||||
vrenderparams -shadingModel phong
|
||||
|
||||
vrenderparams -depthPrePass off
|
||||
vdump $::imagedir/${::casename}_1.png
|
||||
|
||||
vrenderparams -depthPrePass on
|
||||
vdump $::imagedir/${::casename}_2.png
|
||||
|
||||
if { [diffimage $::imagedir/${::casename}_1.png $::imagedir/${::casename}_2.png 0 0 0 $::imagedir/${::casename}_diff.png] != 0 } { puts "Error: images differ" }
|
54
tests/opengl/data/general/double_precision
Normal file
54
tests/opengl/data/general/double_precision
Normal file
@@ -0,0 +1,54 @@
|
||||
puts "========"
|
||||
puts "0024393: Visualization - objects position with enhanced precision"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vzbufftrihedron
|
||||
circle c 0 0 0 0.001
|
||||
mkedge e c
|
||||
wire w e
|
||||
plane s
|
||||
mkface f0 s w
|
||||
mkface f1000 s w
|
||||
ttranslate f1000 1000 0 0
|
||||
# Display object with pre-applied transformation.
|
||||
# Result presentation is already corrupted
|
||||
# AND it jumps while rotating the camera.
|
||||
vpoint v1000 1000 0 0.001
|
||||
vdisplay -dispMode 1 f1000
|
||||
vfit
|
||||
|
||||
# Display object with external transformation.
|
||||
# Result presentation jumps while rotating the camera.
|
||||
vdisplay -dispMode 1 f0
|
||||
vsetlocation f0 1000 0 0
|
||||
|
||||
# Display object with external transformation
|
||||
# in Z-layer with translated Origin.
|
||||
# Result presentation does not jump while rotating the camera.
|
||||
vzlayer top -origin 1000 0 0
|
||||
vdisplay -dispMode 1 -top f0
|
||||
|
||||
# check transformation persistence
|
||||
vtrihedron tt
|
||||
vdisplay -top -trihedron topLeft 100 100 tt
|
||||
|
||||
box zp 40 50 30
|
||||
vdisplay -top -dispMode 1 -trsfPers zoom -trsfPersPos 1000 0 0 zp
|
||||
|
||||
# check clippling planes
|
||||
vclipplane pln -equation -1 0 0 1000 -set
|
||||
|
||||
# check positional lights
|
||||
vlight add positional pos 1000 0 0.001 color RED1 headlight 0
|
||||
|
||||
vremove f1000
|
||||
vmoveto 220 220
|
||||
|
||||
vdrawtext text Text -pos 0 0 0
|
||||
vdisplay -top text -trsfPers zoomRotate -trsfPersPos 1000 0 0.001
|
||||
|
||||
vdump $::imagedir/${::casename}.png
|
22
tests/opengl/data/general/light_off
Normal file
22
tests/opengl/data/general/light_off
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "Test to verify the lights are turned off after 'vlight clear' (and scene is black)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
vlight clear
|
||||
|
||||
set color [vreadpixel 100 100 rgb]
|
||||
set black "0 0 0"
|
||||
if {[string equal $color $black] != 1} {error "Lights do not seems to be cleared!"}
|
34
tests/opengl/data/general/msaa
Normal file
34
tests/opengl/data/general/msaa
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "Multisampling FBOs"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 2 3 1
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 w=512 h=512
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vsetdispmode 0
|
||||
vdisplay b
|
||||
vfit
|
||||
vrotate 0.5 0 0
|
||||
vzbufftrihedron
|
||||
|
||||
vrenderparams -msaa 0
|
||||
vdump $::imagedir/${::casename}_512x512_msaa0.png
|
||||
vrenderparams -msaa 2
|
||||
vdump $::imagedir/${::casename}_512x512_msaa2.png
|
||||
vrenderparams -msaa 4
|
||||
vdump $::imagedir/${::casename}_512x512_msaa4.png
|
||||
vrenderparams -msaa 8
|
||||
vdump $::imagedir/${::casename}_512x512_msaa8.png
|
||||
|
||||
# check dump with resolutions not equal to window size
|
||||
vdump $::imagedir/${::casename}_1920x1080_msaa8.png -width 1920 -height 1080
|
||||
vdump $::imagedir/${::casename}_2560x1440_msaa8.png -width 2560 -height 1440
|
||||
|
||||
# check dump with stereo
|
||||
vstereo anaglyph
|
||||
vdump $::imagedir/${::casename}_512x512_msaa8stereo.png -stereo blend
|
||||
vdump $::imagedir/${::casename}_1920x1080_msaa8stereo.png -width 1920 -height 1080 -stereo blend
|
||||
vdump $::imagedir/${::casename}_2560x1440_msaa8stereo.png -width 2560 -height 1440 -stereo blend
|
41
tests/opengl/data/general/rendscale
Normal file
41
tests/opengl/data/general/rendscale
Normal file
@@ -0,0 +1,41 @@
|
||||
puts "========"
|
||||
puts "Rendering resolution scale factor"
|
||||
puts "========"
|
||||
|
||||
set aFontFile ""
|
||||
catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set aLabelFont "Arial"
|
||||
if { "$aFontFile" != "" } {
|
||||
vfont add "$aFontFile" SansFont
|
||||
set aLabelFont "SansFont"
|
||||
}
|
||||
|
||||
box b 1 2 3
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vdisplay b
|
||||
vfit
|
||||
vpoint p 0 0 0
|
||||
vzbufftrihedron
|
||||
vdrawtext t Text2d -font $aLabelFont
|
||||
vtrihedron tt
|
||||
vdisplay -trsfPers zoom -trsfPersPos 1 0 0 tt
|
||||
text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
|
||||
vdisplay ttl -2d topLeft -dispMode 1
|
||||
vcolorscale cs -demo
|
||||
|
||||
vrenderparams -rendScale 1
|
||||
vdump $::imagedir/${::casename}_100.png
|
||||
|
||||
vrenderparams -rendScale 0.5
|
||||
vdump $::imagedir/${::casename}_050.png
|
||||
|
||||
vrenderparams -rendScale 0.75
|
||||
vdump $::imagedir/${::casename}_075.png
|
||||
|
||||
vrenderparams -rendScale 2
|
||||
vdump $::imagedir/${::casename}_200.png
|
36
tests/opengl/data/general/stereo
Normal file
36
tests/opengl/data/general/stereo
Normal file
@@ -0,0 +1,36 @@
|
||||
puts "========"
|
||||
puts "Stereo output modes"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
restore [locate_data_file occ/fuse.brep] f
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay f
|
||||
vfit
|
||||
vrotate -0.5 0.0 0.0
|
||||
|
||||
vstereo -mode anaglyph
|
||||
vfit
|
||||
vdump $::imagedir/${::casename}_anaglyph.png -stereo blend
|
||||
|
||||
vstereo -mode columnInterlaced
|
||||
vdump $::imagedir/${::casename}_col.png -stereo blend
|
||||
|
||||
vstereo -mode chessBoard
|
||||
vdump $::imagedir/${::casename}_chess.png -stereo blend
|
||||
|
||||
vstereo -mode rowInterlaced
|
||||
vdump $::imagedir/${::casename}_row.png -stereo blend
|
||||
|
||||
vstereo -mode sideBySide
|
||||
vdump $::imagedir/${::casename}_sbs_anamorph.png -stereo blend
|
||||
|
||||
vstereo -mode overUnder
|
||||
vdump $::imagedir/${::casename}_overunder_anamorph.png -stereo blend
|
||||
|
||||
vdump $::imagedir/${::casename}_sbs.png -stereo sbs
|
85
tests/opengl/data/general/tiles
Normal file
85
tests/opengl/data/general/tiles
Normal file
@@ -0,0 +1,85 @@
|
||||
puts "========"
|
||||
puts "Tiled image dump"
|
||||
puts "========"
|
||||
|
||||
set aFontFile ""
|
||||
catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 2 3 1
|
||||
box b2 50 20 30
|
||||
|
||||
set aLabelFont "Arial"
|
||||
if { "$aFontFile" != "" } {
|
||||
vfont add "$aFontFile" SansFont
|
||||
set aLabelFont "SansFont"
|
||||
}
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vraytrace 0
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vsetdispmode 0
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vrotate 0.5 0 0
|
||||
vzbufftrihedron
|
||||
|
||||
catch { vzlayer del 1 }
|
||||
set aLayerId [vzlayer add]
|
||||
vzlayer $aLayerId -enable depthClear -disable rayTracing
|
||||
|
||||
vtrihedron trh
|
||||
vdisplay -noupdate trh -layer $aLayerId -trihedron topRight 100 100
|
||||
|
||||
text2brep tcc "Center" -font $aLabelFont -height 30 -pos -40 0 0
|
||||
vdisplay -noupdate tcc -2d center -layer $aLayerId -dispMode 1
|
||||
polyline lcc -50 -50 0 -50 50 0 50 50 0 50 0 0 0 -50 0 -50 -50 0
|
||||
vdisplay -noupdate lcc -2d center -layer $aLayerId
|
||||
vsetwidth -noupdate lcc 2
|
||||
|
||||
text2brep tbl "Bottom-Left" -font $aLabelFont -height 30 -pos 0 3 5
|
||||
vdisplay -noupdate tbl -2d bottomLeft -layer $aLayerId -dispMode 1
|
||||
polyline lbl 0 0 0 0 100 0 100 100 0 100 50 0 50 0 0 0 0 0
|
||||
vdisplay -noupdate lbl -2d bottomLeft -layer $aLayerId
|
||||
vsetwidth -noupdate lbl 2
|
||||
|
||||
text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
|
||||
vdisplay -noupdate ttl -2d topLeft -layer $aLayerId -dispMode 1
|
||||
polyline ltl 0 -100 0 0 0 0 100 0 0 100 -50 0 50 -100 0 0 -100 0
|
||||
vdisplay -noupdate ltl -2d topLeft -layer $aLayerId
|
||||
vsetwidth -noupdate ltl 2
|
||||
|
||||
text2brep ttr "Top-Right" -font $aLabelFont -height 30 -pos -130 -30 0
|
||||
vdisplay -noupdate ttr -2d topRight -layer $aLayerId -dispMode 1
|
||||
polyline ltr -100 -100 0 -100 0 0 0 0 0 0 -50 0 -50 -100 0 -100 -100 0
|
||||
vdisplay -noupdate ltr -2d topRight -layer $aLayerId
|
||||
vsetwidth -noupdate ltr 2
|
||||
|
||||
text2brep tbr "Bottom-Right" -font $aLabelFont -height 30 -pos -180 3 0
|
||||
vdisplay -noupdate tbr -2d bottomRight -layer $aLayerId -dispMode 1
|
||||
polyline lbr -100 0 0 -100 100 0 0 100 0 0 50 0 -50 0 0 -100 0 0
|
||||
vdisplay -noupdate lbr -2d bottomRight -layer $aLayerId
|
||||
vsetwidth -noupdate lbr 2
|
||||
|
||||
vdrawtext t2 "Label" -pos 1 0 1 -font $aLabelFont
|
||||
vdisplay b2 -trsfPers zoom -trsfPersPos 1 0 1
|
||||
|
||||
vdump $::imagedir/${::casename}_409x409_tile0.png
|
||||
vdump $::imagedir/${::casename}_409x409_tile128.png -tileSize 128
|
||||
vdump $::imagedir/${::casename}_409x409_tile1024.png -tileSize 1024
|
||||
vdump $::imagedir/${::casename}_1920x1080_tile0.png -width 1920 -height 1920
|
||||
vdump $::imagedir/${::casename}_1920x1080_tile128.png -width 1920 -height 1920 -tileSize 128
|
||||
vdump $::imagedir/${::casename}_1920x1080_tile1024.png -width 1920 -height 1920 -tileSize 1024
|
||||
diffimage $::imagedir/${::casename}_409x409_tile0.png $::imagedir/${::casename}_409x409_tile128.png 0 0 0 $::imagedir/${::casename}_409x409_tile128diff.png
|
||||
|
||||
# check dump with stereo
|
||||
vstereo anaglyph
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile0.png -stereo blend
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile128.png -stereo blend -tileSize 128
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile1024.png -stereo blend -tileSize 1024
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile0.png -width 1920 -height 1920 -stereo blend
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile128.png -width 1920 -height 1920 -stereo blend -tileSize 128
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
|
||||
diffimage $::imagedir/${::casename}_409x409_stereotile0.png $::imagedir/${::casename}_409x409_stereotile128.png 0 0 0 $::imagedir/${::casename}_409x409_stereotile128diff.png
|
59
tests/opengl/data/geom/geom1
Normal file
59
tests/opengl/data/geom/geom1
Normal file
@@ -0,0 +1,59 @@
|
||||
puts "========"
|
||||
puts "0029074: Visualization, TKOpenGl - support Geometry Shader definition"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set aShaderVert "
|
||||
out vec4 VertColor;
|
||||
void main() {
|
||||
VertColor = occColor;
|
||||
gl_Position = occVertex;
|
||||
}"
|
||||
|
||||
# define a Geometry shader drawing shrinked triangles
|
||||
set aShaderGeom "
|
||||
layout(triangles) in;
|
||||
layout(triangle_strip, max_vertices=3) out;
|
||||
in vec4 VertColor\[3\];
|
||||
out vec4 Color;
|
||||
void main() {
|
||||
mat4 aMat = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix;
|
||||
vec3 aCenter = vec3 (0.0, 0.0, 0.0);
|
||||
for (int aTriVertIter = 0; aTriVertIter < 3; ++aTriVertIter) {
|
||||
aCenter += gl_in\[aTriVertIter\].gl_Position.xyz;
|
||||
}
|
||||
aCenter /= 3.0;
|
||||
for (int aTriVertIter = 0; aTriVertIter < 3; ++aTriVertIter) {
|
||||
vec3 aVec = gl_in\[aTriVertIter\].gl_Position.xyz - aCenter;
|
||||
vec3 aVertRes = aCenter + normalize (aVec) * length (aVec) * 0.75;
|
||||
gl_Position = aMat * vec4 (aVertRes, 1.0);
|
||||
Color = VertColor\[aTriVertIter\] * 2.0;
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}"
|
||||
|
||||
set aShaderFrag "
|
||||
in vec4 Color;
|
||||
void main() {
|
||||
occFragColor = Color;
|
||||
}"
|
||||
|
||||
# draw a box
|
||||
box b 1 2 3
|
||||
vcaps -core
|
||||
vclear
|
||||
vinit View1
|
||||
if { [string match "OpenGL ES 2.0*" [vglinfo VERSION]] || [string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
|
||||
puts "Skipping test case: OpenGL ES 3.2+ is required"
|
||||
return
|
||||
}
|
||||
vaxo
|
||||
vdisplay -dispMode 1 -mutable b
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
vdump $::imagedir/${::casename}_normal.png
|
||||
|
||||
vshaderprog b -vert $aShaderVert -geom $aShaderGeom -frag $aShaderFrag
|
||||
vdump $::imagedir/${::casename}_geom.png
|
72
tests/opengl/data/geom/interior1
Normal file
72
tests/opengl/data/geom/interior1
Normal file
@@ -0,0 +1,72 @@
|
||||
puts "============"
|
||||
puts "0029076: Visualization - implement element shrinking Shader"
|
||||
puts "Test case on spheres"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 -width 768 -height 409
|
||||
vdefaults -autoTriang 0
|
||||
vzbufftrihedron
|
||||
psphere s1 2
|
||||
psphere s2 1
|
||||
psphere s3 1
|
||||
psphere s4 1
|
||||
psphere s5 1
|
||||
compound s1 s2 s3 s4 s5 c
|
||||
incmesh c 1.0
|
||||
vdisplay -dispMode 1 s1 s2 s3 s4 s5
|
||||
vsetlocation s2 -1.3 -1.3 1.3
|
||||
vsetlocation s3 1.3 1.3 1.3
|
||||
vsetlocation s4 1.3 -1.3 0.0
|
||||
vsetlocation s5 -1.3 -1.3 -1.3
|
||||
vrotate 0.0 0.5 0.0
|
||||
vrotate 0.4 0.0 0.0
|
||||
vfit
|
||||
|
||||
vaspects s1 -setShadingModel PHONG -setInteriorStyle HOLLOW -setDrawEdges 1 -color GRAY80
|
||||
vdrawtext t1 " s1: phong hollow-edges " -pos 2 0 0 -disptype SUBTITLE -color BLACK -subColor GRAY80
|
||||
|
||||
vaspects s2 -setShadingModel GOURAUD -setInteriorStyle SOLID -setDrawEdges 1 -setEdgeColor YELLOW
|
||||
vdrawtext t2 " s2: gouraud solid-edges " -pos -1.3 -1.3 2.5 -halign CENTER -disptype SUBTITLE -color BLACK -subColor YELLOW
|
||||
|
||||
vaspects s3 -setShadingModel PHONG -setInteriorStyle SOLID -setDrawEdges 1 -edgeWidth 2 -setEdgeColor BLUE
|
||||
vdrawtext t3 " s3: phong solid-edges " -pos 1.3 1.3 2.5 -halign CENTER -disptype SUBTITLE -color WHITE -subColor BLUE
|
||||
|
||||
vaspects s4 -setShadingModel GOURAUD -setInteriorStyle HIDDENLINE -setDrawEdges 1 -setEdgeColor RED
|
||||
vdrawtext t4 " s4: hiddenline-edges " -pos 1.3 -1.3 -1.3 -halign CENTER -disptype SUBTITLE -color BLACK -subColor RED
|
||||
|
||||
vaspects s5 -setShadingModel FLAT -setInteriorStyle SOLID -setDrawEdges 1 -setEdgeColor 0 1 0 0 -edgeWidth 3
|
||||
vdrawtext t5 " s5: flat solid-edges " -pos -1.3 -1.3 -2.5 -halign CENTER -disptype SUBTITLE -color BLACK -subColor GREEN
|
||||
|
||||
vrenderparams -msaa 0
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_ortho_polmode.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_ortho_glsl.png
|
||||
|
||||
vrenderparams -msaa 4
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_ortho_polmode_msaa.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_ortho_glsl_msaa.png
|
||||
|
||||
vcamera -persp
|
||||
vzoom 0.8
|
||||
vrenderparams -msaa 0
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_persp_polmode.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_persp_glsl.png
|
||||
|
||||
vrenderparams -msaa 4
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_persp_polmode_msaa.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_persp_glsl_msaa.png
|
69
tests/opengl/data/geom/interior2
Normal file
69
tests/opengl/data/geom/interior2
Normal file
@@ -0,0 +1,69 @@
|
||||
puts "============"
|
||||
puts "0029076: Visualization - implement element shrinking Shader"
|
||||
puts "Test case on boxes"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 -width 768 -height 409
|
||||
vzbufftrihedron
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
box b1 -2 0 2 1 0.2 1
|
||||
box b2 2 0 2 1 0.2 1
|
||||
box b3 0 0 0 1 0.2 1
|
||||
box b4 -2 0 -2 1 0.2 1
|
||||
box b5 2 0 -2 1 0.2 1
|
||||
vdisplay -dispMode 1 b1 b2 b3 b4 b5
|
||||
vfit
|
||||
|
||||
vaspects b1 -setShadingModel PHONG -setInteriorStyle HOLLOW -setDrawEdges 1 -color BLACK
|
||||
vdrawtext t1 " b1: phong hollow-edges " -pos -2 0 2 -halign RIGHT -disptype SUBTITLE -color WHITE -subColor BLACK
|
||||
|
||||
vaspects b2 -setShadingModel GOURAUD -setInteriorStyle SOLID -setDrawEdges 1 -setEdgeColor YELLOW
|
||||
vdrawtext t2 " b2: gouraud solid-edges " -pos 2 0 2 -halign RIGHT -disptype SUBTITLE -color BLACK -subColor YELLOW
|
||||
|
||||
vaspects b3 -setShadingModel PHONG -setInteriorStyle SOLID -setDrawEdges 1 -edgeWidth 2 -setEdgeColor BLUE
|
||||
vdrawtext t3 " b3: phong solid-edges " -pos 0 0 0 -halign RIGHT -disptype SUBTITLE -color WHITE -subColor BLUE
|
||||
|
||||
vaspects b4 -setShadingModel GOURAUD -setInteriorStyle HIDDENLINE -setDrawEdges 1 -setEdgeColor RED
|
||||
vdrawtext t4 " b4: hiddenline-edges " -pos -2 0 -2 -halign RIGHT -disptype SUBTITLE -color BLACK -subColor RED
|
||||
|
||||
vaspects b5 -setShadingModel FLAT -setInteriorStyle SOLID -setDrawEdges 1 -setEdgeColor 0 1 0 0 -edgeWidth 3
|
||||
vdrawtext t5 " b5: flat solid-edges " -pos 2 0 -2 -halign RIGHT -disptype SUBTITLE -color BLACK -subColor GREEN
|
||||
|
||||
vdrawparray p6 triangles v 0 0 0 v 0 1 0 v 1 1 0 v 1 0 0 v 2 1 0 v 2 0 0 e 3 e 1 e 2 e 1 e 3 e 4 e 5 e 4 e 3 e 4 e 5 e 6
|
||||
vlocation p6 -setLocation 2 1 0
|
||||
vaspects p6 -setInteriorStyle SOLID -setDrawEdges 1 -setEdgeColor FIREBRICK -setEdgeWidth 4 -setQuadEdges 1
|
||||
vdrawtext t6 " p6: quads " -pos 2 1 -0.4 -halign RIGHT -disptype SUBTITLE -color BLACK -subColor FIREBRICK
|
||||
|
||||
vrenderparams -msaa 0
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_ortho_polmode.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_ortho_glsl.png
|
||||
|
||||
vrenderparams -msaa 4
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_ortho_polmode_msaa.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_ortho_glsl_msaa.png
|
||||
|
||||
vcamera -persp
|
||||
vzoom 0.7
|
||||
vrenderparams -msaa 0
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_persp_polmode.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_persp_glsl.png
|
||||
|
||||
vrenderparams -msaa 4
|
||||
vcaps -polygonMode 1
|
||||
vdump $imagedir/${casename}_persp_polmode_msaa.png
|
||||
|
||||
vcaps -polygonMode 0
|
||||
vdump $imagedir/${casename}_persp_glsl_msaa.png
|
79
tests/opengl/data/geom/tess1
Normal file
79
tests/opengl/data/geom/tess1
Normal file
@@ -0,0 +1,79 @@
|
||||
puts "========"
|
||||
puts "0029074: Visualization, TKOpenGl - support of Tessellation Shaders"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set aShaderVert "
|
||||
out vec4 VertColor;
|
||||
void main() {
|
||||
VertColor = occColor;
|
||||
gl_Position = occVertex;
|
||||
}"
|
||||
|
||||
set aShaderTessCtrl "
|
||||
layout(vertices = 3) out;
|
||||
void main() {
|
||||
if (gl_InvocationID == 0) {
|
||||
gl_TessLevelInner\[0\] = 7.0;
|
||||
gl_TessLevelOuter\[0\] = 2.0;
|
||||
gl_TessLevelOuter\[1\] = 3.0;
|
||||
gl_TessLevelOuter\[2\] = 7.0;
|
||||
}
|
||||
gl_out\[gl_InvocationID\].gl_Position = gl_in\[gl_InvocationID\].gl_Position;
|
||||
}"
|
||||
|
||||
set aShaderTessEval "
|
||||
layout(triangles, equal_spacing, ccw) in;
|
||||
void main() {
|
||||
vec3 aPnt0 = gl_TessCoord.x * gl_in\[0\].gl_Position.xyz;
|
||||
vec3 aPnt1 = gl_TessCoord.y * gl_in\[1\].gl_Position.xyz;
|
||||
vec3 aPnt2 = gl_TessCoord.z * gl_in\[2\].gl_Position.xyz;
|
||||
gl_Position = vec4 (aPnt0 + aPnt1 + aPnt2, 1.0);
|
||||
}"
|
||||
|
||||
set aShaderGeom "
|
||||
layout(triangles) in;
|
||||
layout(triangle_strip, max_vertices=3) out;
|
||||
void main() {
|
||||
mat4 aMat = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix;
|
||||
vec3 aCenter = vec3 (0.0, 0.0, 0.0);
|
||||
for (int aTriVertIter = 0; aTriVertIter < 3; ++aTriVertIter) {
|
||||
aCenter += gl_in\[aTriVertIter\].gl_Position.xyz;
|
||||
}
|
||||
aCenter /= 3.0;
|
||||
for (int aTriVertIter = 0; aTriVertIter < 3; ++aTriVertIter) {
|
||||
vec3 aVec = gl_in\[aTriVertIter\].gl_Position.xyz - aCenter;
|
||||
vec3 aVertRes = aCenter + normalize (aVec) * length (aVec) * 0.75;
|
||||
gl_Position = aMat * vec4 (aVertRes, 1.0);
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}"
|
||||
|
||||
set aShaderFrag "
|
||||
void main() {
|
||||
occFragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}"
|
||||
|
||||
# draw a box
|
||||
box b 1 2 3
|
||||
explode b F
|
||||
|
||||
vcaps -core
|
||||
vclear
|
||||
vinit View1
|
||||
if { [string match "OpenGL ES 2.0*" [vglinfo VERSION]] || [string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
|
||||
puts "Skipping test case: OpenGL ES 3.2+ is required"
|
||||
return
|
||||
}
|
||||
vaxo
|
||||
vdisplay -dispMode 1 -mutable b_1
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with built-in shader
|
||||
vdump $::imagedir/${::casename}_normal.png
|
||||
|
||||
vshaderprog b_1 -vert $aShaderVert -tessCtrl $aShaderTessCtrl -tessEval $aShaderTessEval -geom $aShaderGeom -frag $aShaderFrag
|
||||
vdump $::imagedir/${::casename}_tess.png
|
13
tests/opengl/data/hatch/bug28107
Normal file
13
tests/opengl/data/hatch/bug28107
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "==========="
|
||||
puts "OCC28107: Visualization - provide a flexible interface to set custom hatch styles"
|
||||
puts "==========="
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION MODELING
|
||||
box b 1 1 1
|
||||
vinit View1
|
||||
vdisplay b -dispMode 1
|
||||
vfit
|
||||
|
||||
vaspects b -setHatch 4
|
||||
vdump $imagedir/${casename}_hatch.png
|
15
tests/opengl/data/hatch/bug28306
Normal file
15
tests/opengl/data/hatch/bug28306
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "============"
|
||||
puts "OCC28306 Visualization - viewer crashes if style for shaded display is set to HATCH"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION MODELING
|
||||
vclear
|
||||
vinit View1
|
||||
pload MODELING VISUALIZATION
|
||||
box b 10 10 10
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vaspects b -setInteriorStyle HATCH
|
||||
|
||||
vdump $imagedir/${casename}.png
|
23
tests/opengl/data/hatch/bug31702
Normal file
23
tests/opengl/data/hatch/bug31702
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "0031702: Visualization, TKOpenGl - hatching interior is ignored in second View within the Viewer"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose *
|
||||
vinit v1/v1
|
||||
box b1 100 200 300
|
||||
vdisplay -dispMode 1 b1
|
||||
vfit
|
||||
vaspects b1 -interior hatch
|
||||
if { [vreadpixel 201 200 -rgb -name] != "BLACK" } { puts "Error: no hatching in first view" }
|
||||
vdump ${imagedir}/${casename}_v1.png
|
||||
|
||||
vinit v2/v1
|
||||
box b2 100 200 300
|
||||
vdisplay -dispMode 1 b2
|
||||
vfit
|
||||
vaspects b2 -interior hatch
|
||||
if { [vreadpixel 201 200 -rgb -name] != "BLACK" } { puts "Error: no hatching in second view" }
|
||||
vdump ${imagedir}/${casename}_v2.png
|
16
tests/opengl/data/lines/bug26790
Normal file
16
tests/opengl/data/lines/bug26790
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "============"
|
||||
puts "OCC26790 apply view resolution to the line width"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose all
|
||||
vinit View1
|
||||
box b0 1 2 3
|
||||
vdisplay b0
|
||||
vfit
|
||||
vdump $imagedir/${casename}_def.png
|
||||
|
||||
vrenderparams -resolution 144
|
||||
vdump $imagedir/${casename}_144.png
|
18
tests/opengl/data/lines/bug30713
Normal file
18
tests/opengl/data/lines/bug30713
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "============="
|
||||
puts "0030713: Visualization, TKOpenGl - stipple line artifacts on Intel UHD Graphics 630"
|
||||
puts "============="
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 1 2 3
|
||||
vclear
|
||||
vinit View1
|
||||
vglinfo
|
||||
vdisplay -dispMode 0 b
|
||||
vtop
|
||||
vfit
|
||||
vzoom 0.8
|
||||
vaspects b -lineType DASH
|
||||
vrotate 0 0 0.785
|
||||
vfit
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
18
tests/opengl/data/lines/stipple_line1
Normal file
18
tests/opengl/data/lines/stipple_line1
Normal file
@@ -0,0 +1,18 @@
|
||||
pload VISUALIZATION MODELING
|
||||
|
||||
restore [locate_data_file occ/fuse.brep] f
|
||||
|
||||
vcaps -ffp 1
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vclear
|
||||
vsetdispmode 0
|
||||
vaxo
|
||||
vdisplay f
|
||||
vaspects f -setLineType dotDash
|
||||
vfit
|
||||
vdump $::imagedir/${::casename}_ffp.png
|
||||
|
||||
vcaps -ffp 0
|
||||
vdump $::imagedir/${::casename}_glsl.png
|
15
tests/opengl/data/lines/stipple_line2
Normal file
15
tests/opengl/data/lines/stipple_line2
Normal file
@@ -0,0 +1,15 @@
|
||||
puts "========"
|
||||
puts "0031174: Visualization - support user-provided stipple line patterns"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b1 1 2 3
|
||||
box b2 1 2 3
|
||||
vclear
|
||||
vinit View1
|
||||
vdisplay -dispMode 0 b1 b2
|
||||
vfit
|
||||
vaspects b1 -setLineWidth 4 -setLineType FF00 -setColor RED -setStippleLineFactor 2
|
||||
vaspects b2 -setLineWidth 4 -setLineType 00FF -setColor GREEN -setStippleLineFactor 2
|
||||
vdump $::imagedir/${::casename}_glsl.png
|
23
tests/opengl/data/markers/bug23654_MarkersRecompute
Normal file
23
tests/opengl/data/markers/bug23654_MarkersRecompute
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "========"
|
||||
puts "OCC23654 Markers recompute"
|
||||
puts "========"
|
||||
|
||||
pload VISUALIZATION
|
||||
vcaps -sprites
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/markers.tcl
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
|
||||
vdump $anImage1
|
||||
|
||||
vclose Driver1/Viewer1/View1 1
|
||||
|
||||
vinit name=View1 l=32 t=32 w=512 h=512
|
||||
vactivate Driver1/Viewer1/View1
|
||||
vbottom
|
||||
vdisplay -noupdate b
|
||||
vfit
|
||||
vremove b
|
||||
|
||||
vdump $anImage2
|
8
tests/opengl/data/markers/bug24131_markers_bitmap
Normal file
8
tests/opengl/data/markers/bug24131_markers_bitmap
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "========"
|
||||
puts "OCC24131 Markers using deprecated glBitmap"
|
||||
puts "========"
|
||||
|
||||
pload VISUALIZATION
|
||||
vcaps -sprites 0 -ffp 1
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/markers.tcl
|
||||
vdump $imagedir/${casename}.png
|
8
tests/opengl/data/markers/bug24131_markers_core
Normal file
8
tests/opengl/data/markers/bug24131_markers_core
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "========"
|
||||
puts "OCC24131 Markers using GLSL programs in Core Profile"
|
||||
puts "========"
|
||||
|
||||
pload VISUALIZATION
|
||||
vcaps -core
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/markers.tcl
|
||||
vdump $imagedir/${casename}.png
|
8
tests/opengl/data/markers/bug24131_markers_glsl
Normal file
8
tests/opengl/data/markers/bug24131_markers_glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "========"
|
||||
puts "OCC24131 Markers using GLSL programs in Compatible Profile"
|
||||
puts "========"
|
||||
|
||||
pload VISUALIZATION
|
||||
vcaps -compatibleProfile -sprites 1 -ffp 0
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/markers.tcl
|
||||
vdump $imagedir/${casename}.png
|
8
tests/opengl/data/markers/bug24131_markers_sprites
Normal file
8
tests/opengl/data/markers/bug24131_markers_sprites
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "========"
|
||||
puts "OCC24131 Markers using Point Sprites and FFP"
|
||||
puts "========"
|
||||
|
||||
pload VISUALIZATION
|
||||
vcaps -sprites 1 -ffp 1
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/markers.tcl
|
||||
vdump $imagedir/${casename}.png
|
20
tests/opengl/data/markers/bug31315
Normal file
20
tests/opengl/data/markers/bug31315
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "============="
|
||||
puts "0031315: Visualization - marker texture is lost after multi-textured object"
|
||||
puts "============="
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
if { [string match "OpenGL ES 2.0*" [vglinfo VERSION]] } {
|
||||
puts "Skipping test case: OpenGL ES 3.0+ is required"
|
||||
return
|
||||
}
|
||||
box b 1 2 3
|
||||
vdisplay -dispMode 1 -highMode 1 b
|
||||
vtexture b -tex0 3 -tex1 4
|
||||
vfit
|
||||
vpoint p0 -1 0 0
|
||||
vaspects p0 -setMarkerSize 5
|
||||
if { [vreadpixel 15 310 -rgb -name] != "BLACK" } { puts "Error: Black color is expected" }
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
57
tests/opengl/data/raytrace/bug24130
Normal file
57
tests/opengl/data/raytrace/bug24130
Normal file
@@ -0,0 +1,57 @@
|
||||
puts "========"
|
||||
puts "OCC24130 Implementing ray tracing visualization core"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# custom shapes
|
||||
set aShape1 [locate_data_file occ/Top.brep]
|
||||
set aShape2 [locate_data_file occ/Bottom.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
vglinfo
|
||||
|
||||
vvbo 0
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
restore $aShape1 s1
|
||||
restore $aShape2 s2
|
||||
vdisplay s1 s2
|
||||
vsetmaterial s1 Silver
|
||||
vsetmaterial s2 Pewter
|
||||
vsetlocation s1 0.0 0.1 0.0
|
||||
vlight -change 0 -dir 0.577 -0.577 -0.577
|
||||
vfit
|
||||
|
||||
# activate ray-tracing
|
||||
vrenderparams -raytrace
|
||||
|
||||
set aModeNum 0
|
||||
foreach aFSAAMode {off on} {
|
||||
foreach aReflMode {off on} {
|
||||
foreach aShadMode {off on} {
|
||||
vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vtextureenv on 5
|
||||
foreach aFSAAMode {off on} {
|
||||
foreach aShadMode {off on} {
|
||||
vrenderparams -shadows $aShadMode -reflections -fsaa $aFSAAMode
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
}
|
||||
}
|
||||
|
||||
vsettransparency s2 0.5
|
||||
for { set aDepth 2 } { $aDepth <= 5 } { incr aDepth } {
|
||||
foreach aFSAAMode {off on} {
|
||||
vrenderparams -raydepth $aDepth -shadows off -fsaa $aFSAAMode
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
}
|
||||
}
|
74
tests/opengl/data/raytrace/bug24819
Normal file
74
tests/opengl/data/raytrace/bug24819
Normal file
@@ -0,0 +1,74 @@
|
||||
puts "========"
|
||||
puts "OCC24819: TKOpenGl - extend the ray-tracing core by visualization of lines, text and point sprites"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
vglinfo
|
||||
|
||||
vvbo 0
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
# 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 RED -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
|
||||
}
|
||||
}
|
||||
}
|
55
tests/opengl/data/raytrace/bug25201
Normal file
55
tests/opengl/data/raytrace/bug25201
Normal file
@@ -0,0 +1,55 @@
|
||||
puts "========"
|
||||
puts "OCC25201: Visualization - Implementing soft shadows and ambient occlusion in OCCT ray-tracing core"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# custom shapes
|
||||
set aShape1 [locate_data_file occ/Top.brep]
|
||||
set aShape2 [locate_data_file occ/Bottom.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
vglinfo
|
||||
|
||||
vvbo 0
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vtextureenv on 4
|
||||
restore $aShape1 s1
|
||||
restore $aShape2 s2
|
||||
vdisplay s1 s2
|
||||
vsetmaterial s1 Gold
|
||||
vsetmaterial s2 Silver
|
||||
vsetlocation s1 0.0 0.1 0.0
|
||||
vlight -change 0 -dir 0.667 -0.667 -0.333
|
||||
vturnview 3.0 -1.2 -0.1
|
||||
vfit
|
||||
|
||||
# activate path tracing
|
||||
vrenderparams -raytrace
|
||||
vrenderparams -gi
|
||||
vrenderparams -rayDepth 12
|
||||
|
||||
set aModeNum 0
|
||||
|
||||
vlight change 0 sm 0.1
|
||||
vlight change 0 int 100
|
||||
vbsdf s1 roughness 6400
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
|
||||
vsetmaterial s1 glass
|
||||
vbsdf s1 absorpcoeff 1.0
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
||||
|
||||
vsetmaterial s2 plaster
|
||||
|
||||
vfps 200
|
||||
vdump $imagedir/${casename}_${aModeNum}.png
|
||||
incr aModeNum
|
70
tests/opengl/data/raytrace/bug25221
Normal file
70
tests/opengl/data/raytrace/bug25221
Normal file
@@ -0,0 +1,70 @@
|
||||
puts "========"
|
||||
puts "OCC25221: Visualization - Depth test errors in ray-tracing scene containing face outlines"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# custom shapes
|
||||
set aShape [locate_data_file occ/Bottom.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
|
||||
vsetdispmode 1
|
||||
restore $aShape s
|
||||
vdisplay s
|
||||
vfit
|
||||
|
||||
# activate ray-tracing
|
||||
vrenderparams -raytrace
|
||||
|
||||
# highlight the shape
|
||||
vmoveto 200 200
|
||||
|
||||
vdump $imagedir/${casename}_lines_closeup.png
|
||||
|
||||
vzoom 0.5
|
||||
|
||||
vdump $imagedir/${casename}_lines_far.png
|
||||
|
||||
vfit
|
||||
|
||||
# change camera to perspective
|
||||
vcamera -persp
|
||||
|
||||
# change highlight display mode
|
||||
vdisplay s -highMode 1
|
||||
|
||||
# highlight the shape again
|
||||
vmoveto 0 0
|
||||
vmoveto 200 200
|
||||
|
||||
vdump $imagedir/${casename}_faces_closeup.png
|
||||
|
||||
# apply transformation
|
||||
vlocation s -reset -translate -30 0 0 -rotate 0 0 0 0 0 1 10
|
||||
vmoveto 0 0
|
||||
vmoveto 200 200
|
||||
|
||||
vdump $imagedir/${casename}_faces_closeup_rotated.png
|
||||
|
||||
vlocation s -reset
|
||||
vmoveto 0 0
|
||||
vmoveto 200 200
|
||||
|
||||
vzoom 0.5
|
||||
|
||||
vdump $imagedir/${casename}_faces_far.png
|
||||
|
||||
# enable Path tracing
|
||||
vrenderparams -gi
|
||||
vfit
|
||||
vfps 100
|
||||
|
||||
vdump $imagedir/${casename}_faces_pt.png
|
||||
|
||||
# rotate camera
|
||||
vrotate 0 0.2 0
|
||||
vfps 100
|
||||
|
||||
vdump $imagedir/${casename}_faces_pt_rot.png
|
46
tests/opengl/data/raytrace/bug25833
Normal file
46
tests/opengl/data/raytrace/bug25833
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "========"
|
||||
puts "OCC25833: Visualization, Ray Tracing - fix problems with the backside of triangles"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
box b1 100 100 100
|
||||
explode b1 Fa
|
||||
box b2 10 10 -20 10 10 10
|
||||
|
||||
vinit View1
|
||||
vdisplay -dispMode 1 b1_5 b1_6 b2
|
||||
vsetmaterial b1_5 steel
|
||||
vsetmaterial b1_6 steel
|
||||
vfit
|
||||
|
||||
# Problem 1: b1_5 (grey) becomes semi-transparent after the next line,
|
||||
# compare it with b1_6 visible from the frontside
|
||||
vrenderparams -rayTrace
|
||||
vdump ${imagedir}/${casename}_1.png
|
||||
checkcolor 100 300 0.37647059559822083 0.3803921639919281 0.40392157435417175
|
||||
if { ${stat} != 1 } {
|
||||
puts "Error : bad color (case 1)"
|
||||
}
|
||||
|
||||
# Problem 2: The small box shows through b1_5
|
||||
vrenderparams -reflections
|
||||
vdump ${imagedir}/${casename}_2.png
|
||||
checkcolor 190 250 0.37647059559822083 0.3803921639919281 0.40392157435417175
|
||||
if { ${stat} != 1 } {
|
||||
puts "Error : bad color (case 2)"
|
||||
}
|
||||
|
||||
ttranslate b2 30 30 30
|
||||
# Problem 3: The small box is not reflected from the backface of b1_5
|
||||
vdisplay -dispMode 1 b2
|
||||
vdump ${imagedir}/${casename}_3.png
|
||||
checkcolor 190 260 0.79607844352722168 0.60784316062927246 0.21960784494876862
|
||||
if { ${stat} != 1 } {
|
||||
puts "Error : bad color (case 3)"
|
||||
}
|
||||
checkcolor 190 310 0.61960786581039429 0.56078433990478516 0.43529412150382996
|
||||
if { ${stat} != 1 } {
|
||||
puts "Error : bad color (case 4)"
|
||||
}
|
69
tests/opengl/data/raytrace/bug26070
Normal file
69
tests/opengl/data/raytrace/bug26070
Normal file
@@ -0,0 +1,69 @@
|
||||
puts "============"
|
||||
puts "OCC26070: Ray tracing with reflections is poor on rotated presentation"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
#source samples/tcl/cad.tc
|
||||
# make base
|
||||
box b0 0 0 0 12 7 6
|
||||
explode b0 e
|
||||
blend b01 b0 1 b0_8
|
||||
blend b02 b01 1 b0_6
|
||||
|
||||
# make cut at bottom
|
||||
box b1 3 -1 0 2 9 1.5
|
||||
bcut b2 b02 b1
|
||||
explode b2 e
|
||||
blend b3 b2 1 b2_27
|
||||
blend b4 b3 1 b2_30
|
||||
|
||||
# make central cut
|
||||
box h1 3 -1 2.5 2 9 0.5
|
||||
box h2 3 -1 3 2 9 2
|
||||
plane p 4 -1 3 0 1 0
|
||||
pcylinder c p 1 9
|
||||
bcommon h3 h2 c
|
||||
bcut b5 b4 h1
|
||||
bcut b6 b5 h3
|
||||
|
||||
# make side cut
|
||||
box b7 9 -1 1 2 9 4
|
||||
explode b7 e
|
||||
blend b71 b7 1 b7_6
|
||||
blend b72 b71 1 b7_8
|
||||
bcut b8 b6 b72
|
||||
|
||||
# make box for inner cylindrical cut
|
||||
box bc1 -1 0 2 9 1 4
|
||||
box bc2 2 -1 2 4 3 3
|
||||
bcut bc3 bc1 bc2
|
||||
explode bc3 e
|
||||
blend bc4 bc3 1 bc3_20
|
||||
blend bc5 bc4 1 bc3_23
|
||||
blend bc6 bc5 1.99 bc3_21
|
||||
blend bc7 bc6 1.99 bc3_22
|
||||
|
||||
# make inner cylindrical cut
|
||||
explode bc7 f
|
||||
revol r bc7_1 -1 0 6 1 0 0 100
|
||||
bcut b9 b8 r
|
||||
|
||||
# make outer cylindrical cut
|
||||
plane p2 -1 0 6 1 0 0
|
||||
pcylinder c2 p2 6 15
|
||||
bcommon res b9 c2
|
||||
|
||||
# show result
|
||||
trotate res 0 0 0 0 0 1 90
|
||||
vinit View1
|
||||
vdisplay res
|
||||
vsetdispmode 1
|
||||
#vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE
|
||||
vfit
|
||||
|
||||
vrenderparams -rayTrace -reflections
|
||||
vlocation res -rotate 0 0 0 0 0 1 180
|
||||
vfit
|
||||
vdump ${imagedir}/${casename}.png
|
30
tests/opengl/data/raytrace/bug26404
Normal file
30
tests/opengl/data/raytrace/bug26404
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "========"
|
||||
puts "OCC26404: Visualization, Ray Tracing - use solid background color when gradient color is disabled"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 1 2 3
|
||||
vinit View1
|
||||
if { [string match "OpenGL ES 2.0*" [vglinfo VERSION]] || [string match "OpenGL ES 3.0*" [vglinfo VERSION]] } {
|
||||
puts "Skipping test case: OpenGL ES 3.2+ is required"
|
||||
return
|
||||
}
|
||||
|
||||
vclear
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
vbackground -color GRAY4
|
||||
vdisplay b
|
||||
vfit
|
||||
vraytrace 1
|
||||
set bug_info_1 [vreadpixel 50 50 rgb name]
|
||||
if {$bug_info_1 != "GRAY4"} {
|
||||
puts "ERROR: OCC26404 is reproduced. Background color is invalid (case #1)."
|
||||
}
|
||||
vbackground -gradient RED BLUE -gradientMode HORIZONTAL
|
||||
vbackground -gradient RED BLUE -gradientMode NONE
|
||||
set bug_info_2 [vreadpixel 50 50 rgb name]
|
||||
if {$bug_info_2 != "GRAY4"} {
|
||||
puts "ERROR: OCC26404 is reproduced. Background color is invalid (case #2)."
|
||||
}
|
38
tests/opengl/data/raytrace/bug26617
Normal file
38
tests/opengl/data/raytrace/bug26617
Normal file
@@ -0,0 +1,38 @@
|
||||
puts "============"
|
||||
puts "CR26617: Visualization, Ray Tracing - adopt progressive rendering Path Tracing for rendering stereoscopic pair"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# custom shapes
|
||||
set aShape1 [locate_data_file occ/Top.brep]
|
||||
set aShape2 [locate_data_file occ/Bottom.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit name=View1 w=512 h=512
|
||||
vglinfo
|
||||
|
||||
vvbo 0
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
restore $aShape1 s1
|
||||
restore $aShape2 s2
|
||||
vdisplay s1 s2
|
||||
vsetmaterial s1 Silver
|
||||
vsetmaterial s2 Pewter
|
||||
vsetlocation s1 0.0 0.1 0.0
|
||||
vlight -change 0 -dir 0.577 -0.577 -0.577
|
||||
|
||||
# activate ray-tracing
|
||||
vrenderparams -raytrace
|
||||
vtextureenv on 5
|
||||
vrenderparams -reflections -gi
|
||||
|
||||
# activate stereo
|
||||
vstereo on
|
||||
vstereo -mode anaglyph
|
||||
vcamera -iod 0.1
|
||||
vfit
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png -stereo blend
|
28
tests/opengl/data/raytrace/bug26676
Normal file
28
tests/opengl/data/raytrace/bug26676
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "============"
|
||||
puts "0026676: Visualization, Ray Tracing - correct rendering if stereo pair"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1 w=400 h=400
|
||||
vclear
|
||||
|
||||
box b 1 2 50
|
||||
vraytrace 0
|
||||
vaxo
|
||||
vsetdispmode 1
|
||||
vdisplay b
|
||||
vcamera -persp
|
||||
vfit
|
||||
vrotate 0 -1.2 0
|
||||
vzoom 1.2
|
||||
|
||||
vstereo -anaglyph redCyan
|
||||
vcamera -iod
|
||||
vcamera -iod 0.3
|
||||
|
||||
vraytrace 1
|
||||
|
||||
vselect 200 350
|
||||
|
||||
vdump ${imagedir}/${casename}.png -stereo blend
|
19
tests/opengl/data/raytrace/bug26975
Normal file
19
tests/opengl/data/raytrace/bug26975
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============"
|
||||
puts "CR26975: Visualization, TKOpenGl - handle triangle strips correctly within Ray-Tracing core"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vraytrace 0
|
||||
vdrawparray s trianglestrips v 0 0 0 n 0 0 1 v 0 2 0 n 0 0 1 v 2 0 0 n 0 0 1 v 2 2 0 n 0 0 1
|
||||
vfit
|
||||
vdump $imagedir/${casename}_rt_off.png
|
||||
|
||||
vraytrace 1
|
||||
vdump $imagedir/${casename}_rt_on.png
|
||||
|
||||
set color [vreadpixel 250 250 rgb name]
|
||||
puts $color
|
||||
if { $color == "BLACK" } { puts "ERROR: CR26975 is reproduced. Triangle strips incorrect within Ray-Tracing core." }
|
18
tests/opengl/data/raytrace/bug27083
Normal file
18
tests/opengl/data/raytrace/bug27083
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "========"
|
||||
puts "0027083: Visualization, Ray Tracing - shape with visible face boundaries disappears after turning the ray-tracing on"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION MODELING
|
||||
box b 1 1 1
|
||||
vclear
|
||||
vinit View1
|
||||
vdisplay -noupdate -dispMode 1 b
|
||||
vfit
|
||||
vaspects b -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryWidth 3
|
||||
vraytrace 1
|
||||
|
||||
if {[vreadpixel 295 255 -rgb -name] != "DARKGOLDENROD"} { puts "ERROR: the box with boundary aspect set is not shown in ray-tracing mode!" }
|
||||
if {[vreadpixel 105 58 -rgb -name] != "RED"} { puts "ERROR: the box's boundaries are not shown in ray-tracing mode!" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
16
tests/opengl/data/raytrace/bug27130
Normal file
16
tests/opengl/data/raytrace/bug27130
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "============"
|
||||
puts "0027130: Visualization, Ray tracing - skip structures with transformation persistence flag"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION MODELING
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
restore [locate_data_file face1.brep] f
|
||||
vdisplay f
|
||||
box b1 25 25 25
|
||||
vdisplay b1 -trsfPers zoom -trsfPersPos 0 0 0
|
||||
|
||||
vraytrace 1
|
||||
vfit
|
||||
vdump ${imagedir}/${casename}.png
|
18
tests/opengl/data/raytrace/bug27337
Normal file
18
tests/opengl/data/raytrace/bug27337
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "================"
|
||||
puts "0027337: \[Regression vs. 6.9.1\] Selection highlight is poor in ray traced mode with FSAA"
|
||||
puts "================"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 10 10 10
|
||||
vdisplay b
|
||||
vsetdispmode 1
|
||||
vfit
|
||||
vrenderparams -rayTrace -fsaa
|
||||
vmoveto 200 200
|
||||
|
||||
puts "Check result by color in the middle of the top face:"
|
||||
puts "should be color of shading and not of highlight (blue)"
|
||||
checkcolor 205 100 0.64 0.56 0.08
|
||||
|
||||
puts "Check result by image: selection highlight should show only visible edges"
|
||||
vdump ${imagedir}/${casename}.png
|
23
tests/opengl/data/raytrace/bug29395
Normal file
23
tests/opengl/data/raytrace/bug29395
Normal file
@@ -0,0 +1,23 @@
|
||||
puts "=================="
|
||||
puts "0029395: Visualization, V3d_View - Grid disappears forever after enabling RayTracing"
|
||||
puts "=================="
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
|
||||
# Rectangular Grid
|
||||
vclear
|
||||
vinit View1
|
||||
vraytrace 0
|
||||
vgrid -type rectangular
|
||||
vraytrace 1
|
||||
checkcolor 198 197 0.5 0.5 0.5
|
||||
vclose
|
||||
|
||||
# Circular Grid
|
||||
vclear
|
||||
vinit View1
|
||||
vraytrace 0
|
||||
vgrid -type circular
|
||||
vraytrace 1
|
||||
checkcolor 198 197 0.5 0.5 0.5
|
18
tests/opengl/data/raytrace/bug31279
Normal file
18
tests/opengl/data/raytrace/bug31279
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "============"
|
||||
puts "0031279: Visualization, TKOpenGl - environment background is misplaced within Ray-Tracing"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/raytrace.tcl
|
||||
vrenderparams -env
|
||||
vcamera -persp
|
||||
vviewparams -scale 1.3 -proj 0.57 -0.57 0.57 -up -0.4 0.4 0.8 -at -62 -111 -15
|
||||
vtextureenv on 1
|
||||
|
||||
if { [vreadpixel 100 100 rgb name] == "BLACK" } { puts "ERROR: background is misplaced" }
|
||||
|
||||
vcamera -persp
|
||||
vdump $imagedir/${casename}_persp.png
|
||||
|
||||
vcamera -ortho
|
||||
vdump $imagedir/${casename}_ortho.png
|
33
tests/opengl/data/raytrace/connected
Normal file
33
tests/opengl/data/raytrace/connected
Normal file
@@ -0,0 +1,33 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check rendering of multi-connected structures"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create boxes
|
||||
box b1 0 0 0 1 2 3
|
||||
box b2 3 0 0 3 2 1
|
||||
|
||||
# draw box
|
||||
vinit View1
|
||||
vclear
|
||||
vrenderparams -rasterization
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vconnect b1c -3 0 0 b1 b2
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
vfit
|
||||
vclear
|
||||
vconnect b1c -3 0 0 b1 b2
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
|
||||
# turn on ray tracing
|
||||
vrenderparams -raytrace
|
||||
vdump $::imagedir/${::casename}_rt1.png
|
||||
|
||||
vclear
|
||||
vconnect b1c -3 0 0 b1 b2
|
||||
vdump ${imagedir}/${casename}.png
|
10
tests/opengl/data/raytrace/dof_mono
Normal file
10
tests/opengl/data/raytrace/dof_mono
Normal file
@@ -0,0 +1,10 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check depth-of-field"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
vrenderparams -aperture 0.1 -focal 2.0
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
16
tests/opengl/data/raytrace/dof_stereo
Normal file
16
tests/opengl/data/raytrace/dof_stereo
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check depth-of-field"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
vrenderparams -aperture 0.1 -focal 2.0
|
||||
|
||||
# activate stereo
|
||||
vstereo on
|
||||
vstereo -mode anaglyph
|
||||
vcamera -iod 0.1
|
||||
vfit
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png -stereo blend
|
25
tests/opengl/data/raytrace/helmet
Normal file
25
tests/opengl/data/raytrace/helmet
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "========"
|
||||
puts "0031096: Visualization, TKOpenGl - support metallic-roughness texture mapping"
|
||||
puts "========"
|
||||
|
||||
pload XDE OCAF MODELING VISUALIZATION
|
||||
Close D -silent
|
||||
ReadGltf D [locate_data_file bug30691_DamagedHelmet.gltf]
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
XDisplay -dispMode 1 D
|
||||
vaxo
|
||||
vcamera -persp
|
||||
vviewparams -scale 0.412548 -proj 0.54479 -0.790649 0.279424 -up -0.248339 0.166151 0.954317 -at -27.3419 382.603 -233.934
|
||||
|
||||
vtextureenv on 2
|
||||
vlight -change 0 -intensity 2.5
|
||||
vlight -change 1 -intensity 0.3
|
||||
|
||||
vrenderparams -shadingModel PBR
|
||||
vdump ${imagedir}/${casename}_pbr.png
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_pt.png
|
27
tests/opengl/data/raytrace/msaa
Normal file
27
tests/opengl/data/raytrace/msaa
Normal file
@@ -0,0 +1,27 @@
|
||||
puts "========"
|
||||
puts "Multisampling FBOs"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 2 3 1
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1 w=512 h=512
|
||||
vraytrace 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vsetdispmode 0
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vrotate 0.5 0 0
|
||||
vzbufftrihedron
|
||||
|
||||
vrenderparams -msaa 8
|
||||
vdump $::imagedir/${::casename}_512x512_msaa8.png
|
||||
vdump $::imagedir/${::casename}_1920x1080_msaa8.png -width 1920 -height 1080
|
||||
vdump $::imagedir/${::casename}_2560x1440_msaa8.png -width 2560 -height 1440
|
||||
|
||||
# check dump with stereo
|
||||
vstereo anaglyph
|
||||
vdump $::imagedir/${::casename}_512x512_msaa8stereo.png -stereo blend
|
||||
vdump $::imagedir/${::casename}_1920x1080_msaa8stereo.png -width 1920 -height 1080 -stereo blend
|
||||
vdump $::imagedir/${::casename}_2560x1440_msaa8stereo.png -width 2560 -height 1440 -stereo blend
|
34
tests/opengl/data/raytrace/normal_map
Normal file
34
tests/opengl/data/raytrace/normal_map
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "0031275: Visualization, TKOpenGl - handle normal-map texture with Path-Tracing"
|
||||
puts "========"
|
||||
|
||||
pload XDE OCAF MODELING VISUALIZATION
|
||||
Close D -silent
|
||||
ReadGltf D [locate_data_file bug31275_SphereWithNormalMap.glb]
|
||||
|
||||
vclear
|
||||
vinit v -w 1024 -h 1024
|
||||
vbackground -cubemap [locate_data_file Circus_CubeMap_V.png]
|
||||
vcamera -persp
|
||||
vlight -clear
|
||||
vlight -add ambient
|
||||
XDisplay -dispmode 1 D
|
||||
vback
|
||||
vfit
|
||||
|
||||
vrenderparams -ignoreNormalMap on
|
||||
vrenderparams -ray -gi -rayDepth 10
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_without_normal_map.png
|
||||
|
||||
vrenderparams -ignoreNormalMap off
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_with_normal_map_back.png
|
||||
|
||||
vfront
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_with_normal_map_front.png
|
||||
|
||||
vlight -add positional -pos 0 0 0 -head 1 -intensity 10
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}_point_light.png
|
43
tests/opengl/data/raytrace/pbr_spheres
Normal file
43
tests/opengl/data/raytrace/pbr_spheres
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "========"
|
||||
puts "0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing"
|
||||
puts "Spheres grid with different roughness values"
|
||||
puts "========"
|
||||
|
||||
cpulimit 600
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vclose ALL
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/vis_pbr_spheres.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10
|
||||
vcamera -ortho
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_ortho0.png
|
||||
|
||||
vlight -change 1 -intensity 0.3
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_ortho30.png
|
||||
|
||||
vcamera -persp
|
||||
vfit
|
||||
vlight -change 1 -intensity 0.0001
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_persp0.png
|
||||
|
||||
vlight -change 1 -intensity 0.3
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_persp30.png
|
||||
|
||||
set aCubeMap [locate_data_file Circus_CubeMap_V.png]
|
||||
vlight -change 1 -intensity 1
|
||||
vbackground -cubemap $aCubeMap
|
||||
vcamera -ortho
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_orthoenv.png
|
||||
|
||||
vcamera -persp
|
||||
vfps 200
|
||||
vdump $::imagedir/${::casename}_perspenv.png
|
36
tests/opengl/data/raytrace/plastic
Normal file
36
tests/opengl/data/raytrace/plastic
Normal file
@@ -0,0 +1,36 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check lighting on Plastic material"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
|
||||
# draw box
|
||||
vinit View1
|
||||
vclear
|
||||
vrenderparams -rasterization
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay b
|
||||
vsetmaterial b PLASTIC
|
||||
vsetcolor b GREEN
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
set aColorL [vreadpixel 150 250 rgb name]
|
||||
set aColorR [vreadpixel 250 250 rgb name]
|
||||
if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
|
||||
puts "Error: wrong color (fixed pipeline)!"
|
||||
}
|
||||
|
||||
vrenderparams -raytrace
|
||||
set aColorL [vreadpixel 150 250 rgb name]
|
||||
set aColorR [vreadpixel 250 250 rgb name]
|
||||
#if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
|
||||
# puts "Error: wrong color (Ray Tracing)!"
|
||||
#}
|
||||
vdump ${imagedir}/${casename}.png
|
77
tests/opengl/data/raytrace/refraction
Normal file
77
tests/opengl/data/raytrace/refraction
Normal file
@@ -0,0 +1,77 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check refraction"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vrenderparams -rasterization
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
|
||||
box wall1 1 8 8
|
||||
box wall2 1 8 8
|
||||
box wall3 16 8 1
|
||||
|
||||
psphere S1 1.5
|
||||
psphere S2 1.5
|
||||
psphere S3 1.5
|
||||
|
||||
box B1 -1.5 -1.5 -1.5 2.5 2 3
|
||||
box B2 -1.5 -1.5 -1.5 2.5 2 3
|
||||
box B3 -1.5 -1.5 -1.5 2.5 2 3
|
||||
|
||||
vdisplay S1
|
||||
vdisplay S2
|
||||
vdisplay S3
|
||||
|
||||
vdisplay B1
|
||||
vdisplay B2
|
||||
vdisplay B3
|
||||
|
||||
vdisplay wall1
|
||||
vdisplay wall2
|
||||
vdisplay wall3
|
||||
|
||||
vsetlocation S1 2 2 4
|
||||
vsetlocation S2 -2 2 4
|
||||
vsetlocation S3 -6 2 4
|
||||
|
||||
vsetlocation B1 2 6 4
|
||||
vsetlocation B2 -2 6 4
|
||||
vsetlocation B3 -6 6 4
|
||||
|
||||
vsetlocation wall1 -10 0 0
|
||||
vsetlocation wall2 5 0 0
|
||||
vsetlocation wall3 -10 0 -1
|
||||
|
||||
vsetmaterial S1 water
|
||||
vsetmaterial S2 glass
|
||||
vsetmaterial S3 diamond
|
||||
|
||||
vsetmaterial B1 water
|
||||
vsetmaterial B2 glass
|
||||
vsetmaterial B3 diamond
|
||||
|
||||
vsetmaterial wall1 stone
|
||||
vsetmaterial wall2 stone
|
||||
vsetmaterial wall3 pewter
|
||||
|
||||
vsetcolor wall1 red
|
||||
vsetcolor wall2 green
|
||||
|
||||
vsettransparency S1 0.8
|
||||
vsettransparency S2 0.8
|
||||
vsettransparency S3 0.8
|
||||
|
||||
vsettransparency B1 0.8
|
||||
vsettransparency B2 0.8
|
||||
vsettransparency B3 0.8
|
||||
|
||||
vfront
|
||||
vturnview 0 -0.3 0
|
||||
vfit
|
||||
vlight -change 0 -dir -0.577 -0.577 -0.577
|
||||
vlight add directional
|
||||
vrenderparams -raytrace -raydepth 5 -shadows off -reflections -fsaa
|
||||
vdump ${imagedir}/${casename}.png
|
7
tests/opengl/data/raytrace/sample_ball
Normal file
7
tests/opengl/data/raytrace/sample_ball
Normal file
@@ -0,0 +1,7 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Ball sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
vdump $imagedir/${casename}_zoom.png
|
13
tests/opengl/data/raytrace/sample_ball_alpha
Normal file
13
tests/opengl/data/raytrace/sample_ball_alpha
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Ball sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vtexture ball 21 -scale 0.1 0.1
|
||||
vsetmaterial ball plaster
|
||||
vbsdf ball -coatFresnel Constant 0.0
|
||||
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_zoom.png
|
20
tests/opengl/data/raytrace/sample_ball_iss
Normal file
20
tests/opengl/data/raytrace/sample_ball_iss
Normal file
@@ -0,0 +1,20 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Ball sample (ISS mode)"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
cpulimit 1000
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vrenderparams -iss -nbtiles 64
|
||||
vfps 1024
|
||||
vdump $imagedir/${casename}_iss_64.png
|
||||
|
||||
vrenderparams -iss -nbtiles 256
|
||||
vfps 256
|
||||
vdump $imagedir/${casename}_iss_256.png
|
||||
|
||||
vrenderparams -iss -nbtiles 1024
|
||||
vfps 64
|
||||
vdump $imagedir/${casename}_iss_1024.png
|
13
tests/opengl/data/raytrace/sample_ball_wood
Normal file
13
tests/opengl/data/raytrace/sample_ball_wood
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "============"
|
||||
puts "0031135: Visualization, TKOpenGl - texture sRGB -> linear conversion is applied twice by Path Tracer"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_ball.tcl
|
||||
|
||||
vtexture ball 11 -scale 0.1 0.1
|
||||
vsetmaterial ball plaster
|
||||
vbsdf ball -coatFresnel Constant 0.0
|
||||
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_zoom.png
|
8
tests/opengl/data/raytrace/sample_cube
Normal file
8
tests/opengl/data/raytrace/sample_cube
Normal file
@@ -0,0 +1,8 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
22
tests/opengl/data/raytrace/sample_cube_clamp
Normal file
22
tests/opengl/data/raytrace/sample_cube_clamp
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample with radiance clamping"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -maxrad 1.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_1.png
|
||||
|
||||
vrenderparams -maxrad 2.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_2.png
|
||||
|
||||
vrenderparams -maxrad 10.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_10.png
|
||||
|
||||
vrenderparams -maxrad 100.0
|
||||
vfps 100
|
||||
vdump $imagedir/${casename}_100.png
|
19
tests/opengl/data/raytrace/sample_cube_twosided
Normal file
19
tests/opengl/data/raytrace/sample_cube_twosided
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Cube sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vaxo
|
||||
vfit
|
||||
vfps 100
|
||||
|
||||
# Dump image produced with one-sided BSDFs
|
||||
vdump $imagedir/${casename}_onesided.png
|
||||
|
||||
vrenderparams -twoside
|
||||
vfps 100
|
||||
|
||||
# Dump image produced with two-sided BSDFs
|
||||
vdump $imagedir/${casename}_twosided.png
|
7
tests/opengl/data/raytrace/sample_materials
Normal file
7
tests/opengl/data/raytrace/sample_materials
Normal file
@@ -0,0 +1,7 @@
|
||||
puts "============"
|
||||
puts "Visualization - Path Tracing, Materials sample"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_materials.tcl
|
||||
vdump $imagedir/${casename}_materials.png
|
80
tests/opengl/data/raytrace/textures
Normal file
80
tests/opengl/data/raytrace/textures
Normal file
@@ -0,0 +1,80 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check refraction"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vrenderparams -rasterization
|
||||
vsetdispmode 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
|
||||
box wall1 1 8 8
|
||||
box wall2 1 8 8
|
||||
box wall3 16 8 1
|
||||
|
||||
psphere S1 1.5
|
||||
psphere S2 1.5
|
||||
psphere S3 1.5
|
||||
|
||||
box B1 -1.5 -1.5 -1.5 2.5 2 3
|
||||
box B2 -1.5 -1.5 -1.5 2.5 2 3
|
||||
box B3 -1.5 -1.5 -1.5 2.5 2 3
|
||||
|
||||
vdisplay S1
|
||||
vdisplay S2
|
||||
vdisplay S3
|
||||
|
||||
vdisplay B1
|
||||
vdisplay B2
|
||||
vdisplay B3
|
||||
|
||||
vdisplay wall1
|
||||
vdisplay wall2
|
||||
vdisplay wall3
|
||||
|
||||
vtexture S1 8
|
||||
vtexture S2 2
|
||||
vtexture S3 3
|
||||
|
||||
vtexture B1 4
|
||||
vtexture B2 5
|
||||
vtexture B3 6
|
||||
|
||||
vsetlocation S1 2 2 4
|
||||
vsetlocation S2 -2 2 4
|
||||
vsetlocation S3 -6 2 4
|
||||
|
||||
vsetlocation B1 2 6 4
|
||||
vsetlocation B2 -2 6 4
|
||||
vsetlocation B3 -6 6 4
|
||||
|
||||
vsetlocation wall1 -10 0 0
|
||||
vsetlocation wall2 5 0 0
|
||||
vsetlocation wall3 -10 0 -1
|
||||
|
||||
vsetmaterial S1 gold
|
||||
vsetmaterial S2 silver
|
||||
vsetmaterial S3 copper
|
||||
|
||||
vsetmaterial B1 steel
|
||||
vsetmaterial B2 pewter
|
||||
vsetmaterial B3 chrome
|
||||
|
||||
vsetmaterial wall1 stone
|
||||
vsetmaterial wall2 stone
|
||||
vsetmaterial wall3 pewter
|
||||
|
||||
vsetcolor wall1 red
|
||||
vsetcolor wall2 green
|
||||
|
||||
vfront
|
||||
vturnview 0 -0.3 0
|
||||
vfit
|
||||
vlight -clear
|
||||
vlight -add ambient
|
||||
vlight -add directional -dir -0.577 -0.577 -0.577 -head 1
|
||||
vlight -add directional -dir 0.577 0.577 0.577 -head 0
|
||||
|
||||
vrenderparams -raytrace -raydepth 3 -shadows on -reflections -fsaa
|
||||
vdump ${imagedir}/${casename}.png
|
83
tests/opengl/data/raytrace/tiles
Normal file
83
tests/opengl/data/raytrace/tiles
Normal file
@@ -0,0 +1,83 @@
|
||||
puts "========"
|
||||
puts "Tiled image dump"
|
||||
puts "========"
|
||||
|
||||
set aFontFile ""
|
||||
catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 2 3 1
|
||||
box b2 50 20 30
|
||||
|
||||
set aLabelFont "Arial"
|
||||
if { "$aFontFile" != "" } {
|
||||
vfont add "$aFontFile" SansFont
|
||||
set aLabelFont "SansFont"
|
||||
}
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vraytrace 1
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vsetdispmode 0
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vrotate 0.5 0 0
|
||||
vzbufftrihedron
|
||||
|
||||
catch { vzlayer del 1 }
|
||||
set aLayerId [vzlayer add]
|
||||
vzlayer $aLayerId -enable depthClear -disable rayTracing
|
||||
|
||||
vtrihedron trh
|
||||
vdisplay -noupdate trh -layer $aLayerId -trihedron topRight 100 100
|
||||
|
||||
text2brep tcc "Center" -font $aLabelFont -height 30 -pos -40 0 0
|
||||
vdisplay -noupdate tcc -2d center -layer $aLayerId -dispMode 1
|
||||
polyline lcc -50 -50 0 -50 50 0 50 50 0 50 0 0 0 -50 0 -50 -50 0
|
||||
vdisplay -noupdate lcc -2d center -layer $aLayerId
|
||||
vsetwidth -noupdate lcc 2
|
||||
|
||||
text2brep tbl "Bottom-Left" -font $aLabelFont -height 30 -pos 0 3 5
|
||||
vdisplay -noupdate tbl -2d bottomLeft -layer $aLayerId -dispMode 1
|
||||
polyline lbl 0 0 0 0 100 0 100 100 0 100 50 0 50 0 0 0 0 0
|
||||
vdisplay -noupdate lbl -2d bottomLeft -layer $aLayerId
|
||||
vsetwidth -noupdate lbl 2
|
||||
|
||||
text2brep ttl "Top-Left" -font $aLabelFont -height 30 -pos 0 -30 0
|
||||
vdisplay -noupdate ttl -2d topLeft -layer $aLayerId -dispMode 1
|
||||
polyline ltl 0 -100 0 0 0 0 100 0 0 100 -50 0 50 -100 0 0 -100 0
|
||||
vdisplay -noupdate ltl -2d topLeft -layer $aLayerId
|
||||
vsetwidth -noupdate ltl 2
|
||||
|
||||
text2brep ttr "Top-Right" -font $aLabelFont -height 30 -pos -130 -30 0
|
||||
vdisplay -noupdate ttr -2d topRight -layer $aLayerId -dispMode 1
|
||||
polyline ltr -100 -100 0 -100 0 0 0 0 0 0 -50 0 -50 -100 0 -100 -100 0
|
||||
vdisplay -noupdate ltr -2d topRight -layer $aLayerId
|
||||
vsetwidth -noupdate ltr 2
|
||||
|
||||
text2brep tbr "Bottom-Right" -font $aLabelFont -height 30 -pos -180 3 0
|
||||
vdisplay -noupdate tbr -2d bottomRight -layer $aLayerId -dispMode 1
|
||||
polyline lbr -100 0 0 -100 100 0 0 100 0 0 50 0 -50 0 0 -100 0 0
|
||||
vdisplay -noupdate lbr -2d bottomRight -layer $aLayerId
|
||||
vsetwidth -noupdate lbr 2
|
||||
|
||||
vdrawtext t2 "Label" -pos 1 0 1 -font $aLabelFont
|
||||
vdisplay b2 -trsfPers zoom -trsfPersPos 1 0 1
|
||||
|
||||
vdump $::imagedir/${::casename}_409x409_rttile0.png
|
||||
vdump $::imagedir/${::casename}_409x409_rttile128.png
|
||||
vdump $::imagedir/${::casename}_409x409_rttile1024.png
|
||||
vdump $::imagedir/${::casename}_1920x1080_rttile0.png -width 1920 -height 1920
|
||||
vdump $::imagedir/${::casename}_1920x1080_rttile128.png -width 1920 -height 1920 -tileSize 128
|
||||
vdump $::imagedir/${::casename}_1920x1080_rttile1024.png -width 1920 -height 1920 -tileSize 1024
|
||||
|
||||
# check dump with stereo
|
||||
vstereo anaglyph
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile0.png -stereo blend
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile128.png -stereo blend -tileSize 128
|
||||
vdump $::imagedir/${::casename}_409x409_stereotile1024.png -stereo blend -tileSize 1024
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile0.png -width 1920 -height 1920 -stereo blend
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile128.png -width 1920 -height 1920 -stereo blend -tileSize 128
|
||||
vdump $::imagedir/${::casename}_1920x1080_stereotile1024.png -width 1920 -height 1920 -stereo blend -tileSize 1024
|
14
tests/opengl/data/raytrace/tone_mapping
Normal file
14
tests/opengl/data/raytrace/tone_mapping
Normal file
@@ -0,0 +1,14 @@
|
||||
puts "========"
|
||||
puts "Ray Tracing - check tone mapping"
|
||||
puts "========"
|
||||
|
||||
source $env(CSF_OCCTSamplesPath)/tcl/pathtrace_cube.tcl
|
||||
|
||||
vrenderparams -ray -gi -rayDepth 10 -iss
|
||||
|
||||
vrenderparams -tonemapping filmic
|
||||
vrenderparams -exposure -1.0
|
||||
vrenderparams -whitepoint 7.0
|
||||
vfit
|
||||
vfps 200
|
||||
vdump ${imagedir}/${casename}.png
|
29
tests/opengl/data/shaderprog/phong_box
Normal file
29
tests/opengl/data/shaderprog/phong_box
Normal file
@@ -0,0 +1,29 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay b
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
vshaderprog b phong
|
||||
vdump $::imagedir/${::casename}_ph1.png
|
||||
|
||||
vclear
|
||||
vdisplay b
|
||||
vshaderprog b phong
|
||||
vdump $::imagedir/${::casename}_ph2.png
|
||||
vmoveto 250 250
|
33
tests/opengl/data/shaderprog/phong_couple
Normal file
33
tests/opengl/data/shaderprog/phong_couple
Normal file
@@ -0,0 +1,33 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# import model
|
||||
restore [locate_data_file occ/fuse.brep] f
|
||||
tclean f
|
||||
box b 2 0 0 1 0.5 0.25
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vdefaults -absDefl 0.5
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay f
|
||||
vfit
|
||||
vrotate -0.5 0.0 0.0
|
||||
vdisplay b
|
||||
vfit
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
|
||||
vshaderprog f phong
|
||||
vshaderprog b phong
|
||||
vshaderprog b off
|
||||
vrotate -0.2 0.0 0.0
|
||||
vmoveto 100 100
|
||||
vdump $::imagedir/${::casename}_ph1.png
|
32
tests/opengl/data/shaderprog/phong_fuse
Normal file
32
tests/opengl/data/shaderprog/phong_fuse
Normal file
@@ -0,0 +1,32 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# import model
|
||||
restore [locate_data_file occ/fuse.brep] f
|
||||
tclean f
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vdefaults -absDefl 0.5
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay f
|
||||
vfit
|
||||
vrotate -0.5 0.0 0.0
|
||||
vfit
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
vshaderprog f phong
|
||||
vdump $::imagedir/${::casename}_ph1.png
|
||||
|
||||
vclear
|
||||
vdisplay f
|
||||
vshaderprog f phong
|
||||
vdump $::imagedir/${::casename}_ph2.png
|
||||
vmoveto 250 250
|
42
tests/opengl/data/shaderprog/phong_fuse2
Normal file
42
tests/opengl/data/shaderprog/phong_fuse2
Normal file
@@ -0,0 +1,42 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# import model
|
||||
restore [locate_data_file occ/fuse.brep] f
|
||||
tclean f
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vdefaults -absDefl 0.5
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay f
|
||||
vfit
|
||||
vrotate -0.5 0.0 0.0
|
||||
vfit
|
||||
|
||||
# setup lights
|
||||
vlight delete 0
|
||||
vlight delete 0
|
||||
vlight delete 0
|
||||
vlight delete 0
|
||||
vlight delete 0
|
||||
vlight add ambient color WHITE
|
||||
vlight add directional dir 1 0 0 color GREEN headlight 1
|
||||
vlight add directional dir -1 0 0 color RED1 headlight 1
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
vshaderprog f phong
|
||||
vdump $::imagedir/${::casename}_ph1.png
|
||||
|
||||
vclear
|
||||
vdisplay f
|
||||
vshaderprog f phong
|
||||
vdump $::imagedir/${::casename}_ph2.png
|
||||
vmoveto 250 250
|
32
tests/opengl/data/shaderprog/phong_plastic
Normal file
32
tests/opengl/data/shaderprog/phong_plastic
Normal file
@@ -0,0 +1,32 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading), check plastic material"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay b
|
||||
vsetmaterial b PLASTIC
|
||||
vsetcolor b GREEN
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
set aColorL [vreadpixel 150 250 rgb name]
|
||||
set aColorR [vreadpixel 250 250 rgb name]
|
||||
if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } { puts "Error: wrong color (fixed pipeline)!" }
|
||||
|
||||
vshaderprog b phong
|
||||
set aColorL [vreadpixel 150 250 rgb name]
|
||||
set aColorR [vreadpixel 250 250 rgb name]
|
||||
if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } { puts "Error: wrong color (Phong shader)!" }
|
||||
vdump ${imagedir}/${casename}.png
|
34
tests/opengl/data/shaderprog/phong_sides
Normal file
34
tests/opengl/data/shaderprog/phong_sides
Normal file
@@ -0,0 +1,34 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading), check lighting of back faces"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
explode b F
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay b_1 b_2
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with fixed pipeline
|
||||
vdump $::imagedir/${::casename}_OFF.png
|
||||
set aColorB [vreadpixel 150 150 rgb name]
|
||||
set aColorF [vreadpixel 250 250 rgb name]
|
||||
if { "$aColorB" != "$aColorF"} { puts "Error: front/back colors are different!" }
|
||||
set aColorFixed $aColorF
|
||||
|
||||
# activate phong shader
|
||||
vshaderprog phong
|
||||
set aColorB [vreadpixel 150 150 rgb name]
|
||||
set aColorF [vreadpixel 250 250 rgb name]
|
||||
if { "$aColorB" != "$aColorF"} { puts "Error: front/back colors are different!" }
|
||||
if { "$aColorF" != "$aColorFixed"} { puts "Error: colors are different!" }
|
||||
vdump ${imagedir}/${casename}.png
|
30
tests/opengl/data/shaderprog/phong_views
Normal file
30
tests/opengl/data/shaderprog/phong_views
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "========"
|
||||
puts "Per-pixel lighting using GLSL program (Phong shading)"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# create box
|
||||
box b 1 2 3
|
||||
|
||||
# draw box
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vsetdispmode 1
|
||||
vaxo
|
||||
vdisplay b
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
vshaderprog b phong
|
||||
vdump $::imagedir/${::casename}_v1.png
|
||||
|
||||
vinit View2
|
||||
vfit
|
||||
vdump $::imagedir/${::casename}_v2.png
|
||||
vmoveto 250 250
|
||||
vdump $::imagedir/${::casename}_v2sel.png
|
||||
vactivate View1
|
||||
vdump $::imagedir/${::casename}_v1sel.png
|
||||
vclose View2
|
42
tests/opengl/data/shaderprog/texture_multi1
Normal file
42
tests/opengl/data/shaderprog/texture_multi1
Normal file
@@ -0,0 +1,42 @@
|
||||
puts "========"
|
||||
puts "0028912: Visualization, TKOpenGl - multi-texture support"
|
||||
puts "========"
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
set aShaderVert "
|
||||
THE_SHADER_OUT vec2 TexCoord;
|
||||
void main() {
|
||||
TexCoord = occTexCoord.st;
|
||||
gl_Position = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;
|
||||
}"
|
||||
|
||||
set aShaderFrag "
|
||||
uniform sampler2D occSampler1;
|
||||
uniform sampler2D occSampler2;
|
||||
uniform sampler2D occSampler3;
|
||||
THE_SHADER_IN vec2 TexCoord;
|
||||
void main() {
|
||||
if (TexCoord.s < 0.5 && TexCoord.t < 0.5) { occFragColor = occTexture2D(occSampler0, TexCoord.st); }
|
||||
else if (TexCoord.s < 0.5 && TexCoord.t >= 0.5) { occFragColor = occTexture2D(occSampler1, TexCoord.st); }
|
||||
else if (TexCoord.s >= 0.5 && TexCoord.t < 0.5) { occFragColor = occTexture2D(occSampler2, TexCoord.st); }
|
||||
else { occFragColor = occTexture2D(occSampler3, TexCoord.st); }
|
||||
}"
|
||||
|
||||
# draw a box
|
||||
box b 1 2 3
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit View1
|
||||
vaxo
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vrotate 0.2 0.0 0.0
|
||||
|
||||
# take snapshot with built-in shader
|
||||
vtexture b -tex0 3 -tex1 4 -tex2 5 -tex3 6
|
||||
vdump $::imagedir/${::casename}_normal.png
|
||||
|
||||
#vshaderprog b $aShaderVert $aShaderFrag
|
||||
vshaderprog b -vert $aShaderVert -frag $aShaderFrag
|
||||
vdump $::imagedir/${::casename}_multi.png
|
13
tests/opengl/data/shading/bug30102
Normal file
13
tests/opengl/data/shading/bug30102
Normal file
@@ -0,0 +1,13 @@
|
||||
puts "============="
|
||||
puts "0030102: Visualization, TKOpenGl - Graphic3d_TOSM_FACET shading is incorrect in some casesn"
|
||||
puts "============="
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vdrawparray b 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
|
||||
vrotate 0.3 0.0 0.0
|
||||
vfit
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user