mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +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:
parent
66cce03ae5
commit
be3752526f
@ -29,7 +29,7 @@ OpenGl_Caps::OpenGl_Caps()
|
|||||||
pntSpritesDisable (Standard_False),
|
pntSpritesDisable (Standard_False),
|
||||||
keepArrayData (Standard_False),
|
keepArrayData (Standard_False),
|
||||||
#if !defined(GL_ES_VERSION_2_0)
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
ffpEnable (Standard_True),
|
ffpEnable (Standard_False),
|
||||||
useSystemBuffer (Standard_False),
|
useSystemBuffer (Standard_False),
|
||||||
#else
|
#else
|
||||||
ffpEnable (Standard_False),
|
ffpEnable (Standard_False),
|
||||||
|
@ -1055,6 +1055,20 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
|
|||||||
myMaxMsaaSamples = 0;
|
myMaxMsaaSamples = 0;
|
||||||
ReadGlVersion (myGlVerMajor, myGlVerMinor);
|
ReadGlVersion (myGlVerMajor, myGlVerMinor);
|
||||||
myVendor = (const char* )::glGetString (GL_VENDOR);
|
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)
|
#if defined(GL_ES_VERSION_2_0)
|
||||||
(void )theIsCoreProfile;
|
(void )theIsCoreProfile;
|
||||||
|
1
tests/3rdparty/export/end
vendored
1
tests/3rdparty/export/end
vendored
@ -1,3 +1,4 @@
|
|||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} ${format}
|
vexport ${aFile} ${format}
|
||||||
vglinfo
|
vglinfo
|
||||||
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
||||||
|
@ -19,6 +19,7 @@ if { [file exists ${aFile}] } {
|
|||||||
file delete ${aFile}
|
file delete ${aFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport $aFile SVG
|
vexport $aFile SVG
|
||||||
|
|
||||||
if { [file exists ${aFile}] } {
|
if { [file exists ${aFile}] } {
|
||||||
|
@ -3,10 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
pload XSDRAW
|
||||||
vinit
|
vinit
|
||||||
@ -20,6 +16,7 @@ vsetdispmode m 34
|
|||||||
file delete -force ${imagedir}/${test_image}.pdf
|
file delete -force ${imagedir}/${test_image}.pdf
|
||||||
set aFile ${imagedir}/${test_image}.pdf
|
set aFile ${imagedir}/${test_image}.pdf
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} PDF
|
vexport ${aFile} PDF
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -45,6 +42,7 @@ vdisplay a
|
|||||||
file delete -force ${imagedir}/${test_image}.pdf
|
file delete -force ${imagedir}/${test_image}.pdf
|
||||||
set aFile ${imagedir}/${test_image}.pdf
|
set aFile ${imagedir}/${test_image}.pdf
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} PDF
|
vexport ${aFile} PDF
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -45,6 +42,7 @@ vdisplay a
|
|||||||
file delete -force ${imagedir}/${test_image}.ps
|
file delete -force ${imagedir}/${test_image}.ps
|
||||||
set aFile ${imagedir}/${test_image}.ps
|
set aFile ${imagedir}/${test_image}.ps
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} PS
|
vexport ${aFile} PS
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -44,6 +41,7 @@ vdisplay a
|
|||||||
file delete -force ${imagedir}/${test_image}.eps
|
file delete -force ${imagedir}/${test_image}.eps
|
||||||
set aFile ${imagedir}/${test_image}.eps
|
set aFile ${imagedir}/${test_image}.eps
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} EPS
|
vexport ${aFile} EPS
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -46,6 +43,7 @@ vdisplay a
|
|||||||
|
|
||||||
set aFile $imagedir/${test_image}.tex
|
set aFile $imagedir/${test_image}.tex
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} TEX
|
vexport ${aFile} TEX
|
||||||
|
|
||||||
if { [file exists ${aFile}] } {
|
if { [file exists ${aFile}] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -45,6 +42,7 @@ vdisplay a
|
|||||||
file delete -force ${imagedir}/${test_image}.svg
|
file delete -force ${imagedir}/${test_image}.svg
|
||||||
set aFile ${imagedir}/${test_image}.svg
|
set aFile ${imagedir}/${test_image}.svg
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} SVG
|
vexport ${aFile} SVG
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -3,9 +3,6 @@ puts "OCC21091"
|
|||||||
puts "OCC21450"
|
puts "OCC21450"
|
||||||
puts "============"
|
puts "============"
|
||||||
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
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
||||||
|
|
||||||
@ -45,6 +42,7 @@ vdisplay a
|
|||||||
file delete -force ${imagedir}/${test_image}.pgf
|
file delete -force ${imagedir}/${test_image}.pgf
|
||||||
set aFile ${imagedir}/${test_image}.pgf
|
set aFile ${imagedir}/${test_image}.pgf
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vexport ${aFile} PGF
|
vexport ${aFile} PGF
|
||||||
|
|
||||||
if { [checkplatform -windows] } {
|
if { [checkplatform -windows] } {
|
||||||
|
@ -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
|
|
||||||
|
|
@ -8,6 +8,9 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC22368
|
set BugNumber OCC22368
|
||||||
|
|
||||||
|
# enable FFP until bug-fix for GLSL
|
||||||
|
vcaps -ffp 1
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
vtrihedron trihedron
|
vtrihedron trihedron
|
||||||
OCC74_set trihedron 3
|
OCC74_set trihedron 3
|
||||||
|
@ -10,6 +10,7 @@ vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
|||||||
|
|
||||||
set BugNumber OCC22796
|
set BugNumber OCC22796
|
||||||
|
|
||||||
|
vcaps -ffp 1
|
||||||
vinit
|
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
|
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
|
vexport $imagedir/${test_image}.pdf PDF
|
||||||
|
@ -15,8 +15,8 @@ vfit
|
|||||||
vaspects -setwidth 5
|
vaspects -setwidth 5
|
||||||
|
|
||||||
if { "[vreadpixel 183 190 rgb name]" != "RED"
|
if { "[vreadpixel 183 190 rgb name]" != "RED"
|
||||||
|| "[vreadpixel 292 358 rgb name]" != "RED"
|
|| "[vreadpixel 314 344 rgb name]" != "RED"
|
||||||
|| "[vreadpixel 26 265 rgb name]" != "RED"
|
|| "[vreadpixel 26 267 rgb name]" != "RED"
|
||||||
} {
|
} {
|
||||||
puts "Error : Boundary of face is not changed"
|
puts "Error : Boundary of face is not changed"
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ puts "Checking environment mapping in general"
|
|||||||
puts "============"
|
puts "============"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
|
# enable FFP until bug-fix for GLSL
|
||||||
|
vcaps -ffp 1
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
vclear
|
vclear
|
||||||
vaxo
|
vaxo
|
||||||
|
@ -18,6 +18,9 @@ set y2_coord 320
|
|||||||
set x3_coord 73
|
set x3_coord 73
|
||||||
set y3_coord 150
|
set y3_coord 150
|
||||||
|
|
||||||
|
# enable FFP until bug-fix for GLSL
|
||||||
|
vcaps -ffp 1
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
box b1 0 0 0 10 10 10
|
box b1 0 0 0 10 10 10
|
||||||
box b2 30 0 0 10 40 10
|
box b2 30 0 0 10 40 10
|
||||||
|
@ -18,15 +18,13 @@ OCC24622 1D
|
|||||||
vtop
|
vtop
|
||||||
vfit
|
vfit
|
||||||
|
|
||||||
checkcolor 100 200 0 0.5804 0.949
|
set aColor [vreadpixel 100 200 rgb name]
|
||||||
|
if { "$aColor" != "CYAN1" } {
|
||||||
if { $stat != 1 } {
|
|
||||||
puts "Error: the 1D texture color does not match at px (100, 200)!"
|
puts "Error: the 1D texture color does not match at px (100, 200)!"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcolor 300 200 0.298 1.0 0.0
|
set aColor [vreadpixel 300 200 rgb name]
|
||||||
|
if { "$aColor" != "CHARTREUSE" } {
|
||||||
if { $stat != 1 } {
|
|
||||||
puts "Error: the 1D texture color does not match at px (300, 200)!"
|
puts "Error: the 1D texture color does not match at px (300, 200)!"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,15 +35,13 @@ OCC24622 2D
|
|||||||
vtop
|
vtop
|
||||||
vfit
|
vfit
|
||||||
|
|
||||||
checkcolor 200 100 0 0.5804 0.949
|
set aColor [vreadpixel 100 200 rgb name]
|
||||||
|
if { "$aColor" != "DARKGOLDENROD1" } {
|
||||||
if { $stat != 1 } {
|
|
||||||
puts "Error: the 2D texture color does not match at px (200, 100)!"
|
puts "Error: the 2D texture color does not match at px (200, 100)!"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkcolor 200 300 0.298 1.0 0.0
|
set aColor [vreadpixel 200 300 rgb name]
|
||||||
|
if { "$aColor" != "CHARTREUSE" } {
|
||||||
if { $stat != 1 } {
|
|
||||||
puts "Error: the 2D texture color does not match at px (200, 300)!"
|
puts "Error: the 2D texture color does not match at px (200, 300)!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ puts ""
|
|||||||
# Test image dumping with software accelerated GL context
|
# Test image dumping with software accelerated GL context
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
vcaps -softMode
|
vcaps -softMode 1 -ffp 1
|
||||||
vinit View1
|
vinit View1
|
||||||
|
|
||||||
box b 1 2 3
|
box b 1 2 3
|
||||||
|
@ -8,6 +8,9 @@ puts "Displaying \'zbufftrihedron\' interferes with \'vgraduatedtrihedron\'"
|
|||||||
|
|
||||||
set anImage $imagedir/${casename}.png
|
set anImage $imagedir/${casename}.png
|
||||||
|
|
||||||
|
# enable FFP until bug-fix for GLSL
|
||||||
|
vcaps -ffp 1
|
||||||
|
|
||||||
vinit View1
|
vinit View1
|
||||||
psphere s 10
|
psphere s 10
|
||||||
vdisplay s
|
vdisplay s
|
||||||
|
@ -12,6 +12,9 @@ set anImage2 $imagedir/${casename}_2.png
|
|||||||
set anImage3 $imagedir/${casename}_3.png
|
set anImage3 $imagedir/${casename}_3.png
|
||||||
set anImage4 $imagedir/${casename}_4.png
|
set anImage4 $imagedir/${casename}_4.png
|
||||||
|
|
||||||
|
# enable FFP until bug-fix for GLSL
|
||||||
|
vcaps -ffp 1
|
||||||
|
|
||||||
vinit View1
|
vinit View1
|
||||||
psphere s 10
|
psphere s 10
|
||||||
vdisplay s
|
vdisplay s
|
||||||
|
@ -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
|
|
@ -1,4 +1,5 @@
|
|||||||
source $env(CSF_OCCTSamplesPath)/tcl/dimensions.tcl
|
source $env(CSF_OCCTSamplesPath)/tcl/dimensions.tcl
|
||||||
|
vcaps -ffp 1
|
||||||
vdump $imagedir/${test_image}.png
|
vdump $imagedir/${test_image}.png
|
||||||
|
|
||||||
puts "TEST COMPLETED"
|
puts "TEST COMPLETED"
|
||||||
|
@ -8,6 +8,7 @@ mkface s ss
|
|||||||
incmesh s 0.01
|
incmesh s 0.01
|
||||||
|
|
||||||
# draw sphere
|
# draw sphere
|
||||||
|
vcaps -ffp 1
|
||||||
vinit View1
|
vinit View1
|
||||||
vclear
|
vclear
|
||||||
vsetdispmode 1
|
vsetdispmode 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user