1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0027715: Visualization - turn off deprecated OpenGL fixed-function pipeline by default

OpenGl_Caps - flag ffpEnable is now initialized to false on desktop OpenGL.
OpenGl_Context::init() - now prints error if OpenGL version does not support GLSL
and switches OpenGl_Caps::ffpEnable to true.

update test cases
This commit is contained in:
kgv 2016-07-26 22:08:39 +03:00 committed by bugmaster
parent 66cce03ae5
commit be3752526f
24 changed files with 57 additions and 111 deletions

View File

@ -29,7 +29,7 @@ OpenGl_Caps::OpenGl_Caps()
pntSpritesDisable (Standard_False),
keepArrayData (Standard_False),
#if !defined(GL_ES_VERSION_2_0)
ffpEnable (Standard_True),
ffpEnable (Standard_False),
useSystemBuffer (Standard_False),
#else
ffpEnable (Standard_False),

View File

@ -1055,6 +1055,20 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
myMaxMsaaSamples = 0;
ReadGlVersion (myGlVerMajor, myGlVerMinor);
myVendor = (const char* )::glGetString (GL_VENDOR);
if (!caps->ffpEnable
&& !IsGlGreaterEqual (2, 0))
{
caps->ffpEnable = true;
TCollection_ExtendedString aMsg =
TCollection_ExtendedString("OpenGL driver is too old! Context info:\n")
+ " Vendor: " + (const char* )::glGetString (GL_VENDOR) + "\n"
+ " Renderer: " + (const char* )::glGetString (GL_RENDERER) + "\n"
+ " Version: " + (const char* )::glGetString (GL_VERSION) + "\n"
+ " Fallback using deprecated fixed-function pipeline.\n"
+ " Visualization might work incorrectly.\n"
" Consider upgrading the graphics driver.";
PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_PORTABILITY, 0, GL_DEBUG_SEVERITY_HIGH, aMsg);
}
#if defined(GL_ES_VERSION_2_0)
(void )theIsCoreProfile;

View File

@ -1,3 +1,4 @@
vcaps -ffp 1
vexport ${aFile} ${format}
vglinfo
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@ -19,6 +19,7 @@ if { [file exists ${aFile}] } {
file delete ${aFile}
}
vcaps -ffp 1
vexport $aFile SVG
if { [file exists ${aFile}] } {

View File

@ -3,10 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vinit
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#
pload XSDRAW
vinit
@ -20,6 +16,7 @@ vsetdispmode m 34
file delete -force ${imagedir}/${test_image}.pdf
set aFile ${imagedir}/${test_image}.pdf
vcaps -ffp 1
vexport ${aFile} PDF
if { [checkplatform -windows] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to PDF format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -45,6 +42,7 @@ vdisplay a
file delete -force ${imagedir}/${test_image}.pdf
set aFile ${imagedir}/${test_image}.pdf
vcaps -ffp 1
vexport ${aFile} PDF
if { [checkplatform -windows] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to PS format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -45,6 +42,7 @@ vdisplay a
file delete -force ${imagedir}/${test_image}.ps
set aFile ${imagedir}/${test_image}.ps
vcaps -ffp 1
vexport ${aFile} PS
if { [checkplatform -windows] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to EPS format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -44,6 +41,7 @@ vdisplay a
file delete -force ${imagedir}/${test_image}.eps
set aFile ${imagedir}/${test_image}.eps
vcaps -ffp 1
vexport ${aFile} EPS
if { [checkplatform -windows] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to TEX format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -46,6 +43,7 @@ vdisplay a
set aFile $imagedir/${test_image}.tex
vcaps -ffp 1
vexport ${aFile} TEX
if { [file exists ${aFile}] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to SVG format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -45,6 +42,7 @@ vdisplay a
file delete -force ${imagedir}/${test_image}.svg
set aFile ${imagedir}/${test_image}.svg
vcaps -ffp 1
vexport ${aFile} SVG
if { [checkplatform -windows] } {

View File

@ -3,9 +3,6 @@ puts "OCC21091"
puts "OCC21450"
puts "============"
puts ""
#vexport
#vexport full_file_path {PS | EPS | TEX | PDF | SVG | PGF } : exports the view to a vector file of a given format
#Testing export to PGF format
vfont add [locate_data_file DejaVuSans.ttf] SansFont
@ -45,6 +42,7 @@ vdisplay a
file delete -force ${imagedir}/${test_image}.pgf
set aFile ${imagedir}/${test_image}.pgf
vcaps -ffp 1
vexport ${aFile} PGF
if { [checkplatform -windows] } {

View File

@ -1,41 +0,0 @@
puts "============"
puts "OCC22332"
puts "============"
puts ""
######################################################
#
######################################################
set BUGNUMBER OCC22332
vinit
vclear
box b 100 100 100
vsetdispmode b 1
vdisplay b
vtrihedron tri
vfit
vmoveto 0 0
# TEST LINEWIDTH
# draw a 10px horizontal line at (10,10) - (400,10)
vlayerline 10 10 400 10 10
checkcolor 15 5 1 0 0
checkcolor 15 13 1 0 0
checkcolor 15 14 0 0 0
# TEST LINETYPE
# draw a slashed 10px horizontal line at (10,10) - (400,10)
vlayerline 10 10 400 10 10 1
checkcolor 23 10 1 0 0
checkcolor 25 10 1 0 0
checkcolor 26 10 0 0 0
checkcolor 30 10 0 0 0
checkcolor 32 10 1 0 0
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@ -8,6 +8,9 @@ puts ""
set BugNumber OCC22368
# enable FFP until bug-fix for GLSL
vcaps -ffp 1
vinit
vtrihedron trihedron
OCC74_set trihedron 3

View File

@ -10,6 +10,7 @@ vfont add [locate_data_file DejaVuSans.ttf] SansFont
set BugNumber OCC22796
vcaps -ffp 1
vinit
vdrawtext text0 "TestString\nHello,\tWorld!" -pos 0 0 0 -color 1.0 1.0 1.0 -halign left -valign bottom -angle 0 -zoom 1 -height 50 -aspect regular -font SansFont
vexport $imagedir/${test_image}.pdf PDF

View File

@ -15,8 +15,8 @@ vfit
vaspects -setwidth 5
if { "[vreadpixel 183 190 rgb name]" != "RED"
|| "[vreadpixel 292 358 rgb name]" != "RED"
|| "[vreadpixel 26 265 rgb name]" != "RED"
|| "[vreadpixel 314 344 rgb name]" != "RED"
|| "[vreadpixel 26 267 rgb name]" != "RED"
} {
puts "Error : Boundary of face is not changed"
}

View File

@ -4,6 +4,9 @@ puts "Checking environment mapping in general"
puts "============"
puts ""
# enable FFP until bug-fix for GLSL
vcaps -ffp 1
vinit
vclear
vaxo

View File

@ -18,6 +18,9 @@ set y2_coord 320
set x3_coord 73
set y3_coord 150
# enable FFP until bug-fix for GLSL
vcaps -ffp 1
vinit
box b1 0 0 0 10 10 10
box b2 30 0 0 10 40 10

View File

@ -18,16 +18,14 @@ OCC24622 1D
vtop
vfit
checkcolor 100 200 0 0.5804 0.949
if { $stat != 1 } {
puts "Error : the 1D texture color does not match at px (100, 200)!"
set aColor [vreadpixel 100 200 rgb name]
if { "$aColor" != "CYAN1" } {
puts "Error: the 1D texture color does not match at px (100, 200)!"
}
checkcolor 300 200 0.298 1.0 0.0
if { $stat != 1 } {
puts "Error : the 1D texture color does not match at px (300, 200)!"
set aColor [vreadpixel 300 200 rgb name]
if { "$aColor" != "CHARTREUSE" } {
puts "Error: the 1D texture color does not match at px (300, 200)!"
}
vactivate $aV2
@ -37,16 +35,14 @@ OCC24622 2D
vtop
vfit
checkcolor 200 100 0 0.5804 0.949
if { $stat != 1 } {
puts "Error : the 2D texture color does not match at px (200, 100)!"
set aColor [vreadpixel 100 200 rgb name]
if { "$aColor" != "DARKGOLDENROD1" } {
puts "Error: the 2D texture color does not match at px (200, 100)!"
}
checkcolor 200 300 0.298 1.0 0.0
if { $stat != 1 } {
puts "Error : the 2D texture color does not match at px (200, 300)!"
set aColor [vreadpixel 200 300 rgb name]
if { "$aColor" != "CHARTREUSE" } {
puts "Error: the 2D texture color does not match at px (200, 300)!"
}
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@ -7,7 +7,7 @@ puts ""
# Test image dumping with software accelerated GL context
############################################################
vcaps -softMode
vcaps -softMode 1 -ffp 1
vinit View1
box b 1 2 3

View File

@ -8,6 +8,9 @@ puts "Displaying \'zbufftrihedron\' interferes with \'vgraduatedtrihedron\'"
set anImage $imagedir/${casename}.png
# enable FFP until bug-fix for GLSL
vcaps -ffp 1
vinit View1
psphere s 10
vdisplay s

View File

@ -12,6 +12,9 @@ set anImage2 $imagedir/${casename}_2.png
set anImage3 $imagedir/${casename}_3.png
set anImage4 $imagedir/${casename}_4.png
# enable FFP until bug-fix for GLSL
vcaps -ffp 1
vinit View1
psphere s 10
vdisplay s

View File

@ -1,28 +0,0 @@
puts "========="
puts "CR25768"
puts "========="
puts ""
###########################################################################################
# Visualization, Graphic3d_Structure - do not use invalid bounding boxes of empty groups
###########################################################################################
box b 100 0 0 2 1 1
vinit View1
vclear
vaxo
vsetdispmode 0
vdisplay b
vfit
vzoom 0.1
vbounding b
set x_coord 115
set y_coord 153
checkcolor $x_coord $y_coord 0 0 0
if { $stat != 1 } {
puts "Error: invalid broken bounding boxes"
} else {
puts "OK: valid boundong box"
}
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@ -1,4 +1,5 @@
source $env(CSF_OCCTSamplesPath)/tcl/dimensions.tcl
vcaps -ffp 1
vdump $imagedir/${test_image}.png
puts "TEST COMPLETED"

View File

@ -8,6 +8,7 @@ mkface s ss
incmesh s 0.01
# draw sphere
vcaps -ffp 1
vinit View1
vclear
vsetdispmode 1