def onCaeGraphicsStartup(): # get a copy of each GL & GLX string necessary in this function glVendor = session.graphicsInfo.glVendor glRenderer = session.graphicsInfo.glRenderer glVersion = session.graphicsInfo.glVersion glxServerVendor = session.graphicsInfo.glxServerVendor glxServerVersion = session.graphicsInfo.glxServerVersion # Establish default graphics options for all cards: # # ... highlightMethod cannot be changed directly; only through highlightMethodHint # # ... highlightMethod and highlightMethodHint have no effect when backingStore # is set to ON # # ... if hardwareOverlay is set to OFF in this file, it will not # be possible to set it back to ON from /CAE and # hardwareOverlayAvailable will also report OFF. # # ... directRendering can only be set to OFF in this file. # By default /CAE tries to use ON, but if it is already OFF at this # point we won't be able to get it back to ON (and if we try, we # will get a warning), so we initialize it with its current value graphicsDriver = OPEN_GL doubleBuffering = ON backfaceCulling = ON displayLists = ON highlightMethodHint = ( HARDWARE_OVERLAY, SOFTWARE_OVERLAY, XOR, BLEND ) dragMode = AS_IS autoFitAfterRotate = OFF polygonOffsetConstant = session.defaultGraphicsOptions.polygonOffsetConstant polygonOffsetSlope = session.defaultGraphicsOptions.polygonOffsetSlope printPolygonOffsetConstant = session.defaultGraphicsOptions.printPolygonOffsetConstant printPolygonOffsetSlope = session.defaultGraphicsOptions.printPolygonOffsetSlope vertexArrays = ON vertexArraysInDisplayLists = ON textureMapping = ON contourRangeTexturePrecision = 5e-06 printTextureMapping = ON directRendering = session.defaultGraphicsOptions.directRendering hardwareAcceleration = session.defaultGraphicsOptions.hardwareAcceleration accelerateOffScreen = session.defaultGraphicsOptions.accelerateOffScreen hardwareOverlay = session.defaultGraphicsOptions.hardwareOverlay backgroundColor = session.defaultGraphicsOptions.backgroundColor backingStore = session.defaultGraphicsOptions.backingStore antiAlias = session.defaultGraphicsOptions.antiAlias translucencyMode = session.defaultGraphicsOptions.translucencyMode visualId = 0 # Set special case values for specific platforms displayingToWindows = 0 # On Windows, glxServerVendor will be None so we will need # the same values as when displaying on Windows through Hummingbird if glxServerVendor == None or \ glxServerVendor == "Hummingbird Communications Ltd." or \ glxServerVendor == "Hummingbird Ltd.": displayingToWindows = 1 # Seeing issues so only enable where it is known to work. accelerateOffScreen = OFF # Use these defaults for Windows XP or later polygonOffsetConstant = 1.0 polygonOffsetSlope = 0.75 # Use these defaults for earlier releases of Windows if glxServerVendor == None and glxServerVersion[0] != None: if glxServerVersion[0] <= 4 or \ ( glxServerVersion[0] == 5 and glxServerVersion[1] < 1 ): polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.712 elif glxServerVendor == "SGI": polygonOffsetConstant = 0.04 polygonOffsetSlope = 1.5 elif glxServerVendor == "IBM": if glRenderer == "GXT800 Texture": polygonOffsetConstant = 1.0 polygonOffsetSlope = 2.19 elif glRenderer[:6] == "GXT800": polygonOffsetConstant = 0.87 polygonOffsetSlope = 1.5 # Card specific settings if glVendor == "3Dlabs": backingStore = OFF if glRenderer[:13] == "Wildcat VP880": # For glVersion (1, 3, '.2') vertexArrays = OFF polygonOffsetConstant = 5.5 polygonOffsetSlope = 0.8 elif glRenderer == "PERMEDIA3": if displayingToWindows: # at least glversion == (1, 1, ".28 PT") can not use H/W accel hardwareAcceleration = OFF else: # Permedia 3 Create driver v2.16.0388 polygonOffsetConstant = 0.15 polygonOffsetSlope = 0.75 elif glRenderer == "GLINT R3 PT": # Oxygen VX1 polygonOffsetConstant = 0.05 polygonOffsetSlope = 0.7 # at least glversion == (1, 1, ".28 PT") can not use vertex arrays vertexArrays = OFF # XOR has problems highlightMethodHint = ( HARDWARE_OVERLAY, SOFTWARE_OVERLAY, BLEND ) elif glRenderer[:25] == "GLINT R3 PT + GLINT Gamma": # Oxygen GVX1 polygonOffsetConstant = 0.4 polygonOffsetSlope = 2.0 # at least glversion == (1, 1, ".28 PT") can not use vertex arrays vertexArrays = OFF # XOR has problems highlightMethodHint = ( HARDWARE_OVERLAY, SOFTWARE_OVERLAY, BLEND ) elif glVendor[:3] == "ATI": from re import search, IGNORECASE # Last tested was "RADEON X600" glVersion: (2, 0, '.5757 WinXP Release') if displayingToWindows: accelerateOffScreen = OFF else: polygonOffsetConstant = 1.0 vertexArraysInDisplayLists = OFF # Tested Mobility FireGL V5700, FirePro V4800, FirePro V7800, FirePro V8700, FirePro V9800 contourRangeTexturePrecision=5e-5 # Version specific settings if glVersion[0] > 2 or (glVersion[0] == 2 and glVersion[1] >= 1): import string fields = string.split( glVersion[2], " " ) if len(fields) >= 1: try: fval = string.atof( fields[0] ) except: fval = 0.0 # Account for drivers going from 0.992 to 0.10207 if fval < 0.3 : fval = fval * 10 if fval >= 0.8301: # Later ATI drivers properly support our translucency shaders # - at least 2.1.8301 # On Windows, the V7300 does not handle translucency shaders # On Vista64, the V3400 does not handle translucency shaders if displayingToWindows and (glRenderer == "ATI FireGL V7300" or \ search("V3400", glRenderer) ): translucencyMode = 2 else: import os os.environ['ABAQUS_ALLOW_ATI_TRANSL'] = "1" # On 32-bit Windows, later drivers cannot handle hardware overlay # Feb 25 2010 : 8.663.3? (0.8794) later drivers cannot handle vertex arrays # Feb 25 2010 : 8.683 (0.9236) driver cannot handle depth peeling if fval >= 0.87: vertexArrays = OFF # There is a range where (dual) depth peeling is not supported if fval >= 0.92 and fval < 0.992 and translucencyMode > 3: translucencyMode = 3 elif fval > 0.992: vertexArrays = ON if fval > 1.0: translucencyMode = 5 if displayingToWindows: try: import platform if platform.architecture()[0][:2] == "32": hardwareOverlay = OFF highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) except: hardwareOverlay = OFF highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) # ATI MOBILITY FireGL V5200 - version: (2, 0, '.5527') if search("MOBILITY", glRenderer, IGNORECASE): backingStore = OFF viewManipDisplayListThreshold=0 # FireGL V5250 driver 8.442.3 from 1-3-2008 hardwareOverlay = OFF if search("Fire", glRenderer, IGNORECASE) or \ search("Radeon", glRenderer, IGNORECASE): displayLists = OFF if search("FireGL V", glRenderer) or \ search("FirePro", glRenderer): # If you observe missing facets in shaded displays # or temporarily incorrect edge colors, try setting # displayLists = OFF displayLists = ON # FireGL V3300 Driver (2, 0, '.5648') # FireGL V7100 Driver (1, 3, '.5519 (X4.3.0-8.20.8)') # ATI MOBILITY FireGL V5200 - version: (2, 0, '.5527') # Not sure if this is necessary for Linux... backingStore = OFF if search( "V7100", glRenderer): polygonOffsetConstant = 0.5 polygonOffsetSlope = 1.5 elif search( "V5100", glRenderer): polygonOffsetConstant = 0.8 elif search( "V3200", glRenderer): textureMapping = OFF # The V3400 cannot handle tranlucency shaders on Vista64. elif search( "V3400", glRenderer): textureMapping = OFF # The V9800 has issues if color coding AND translucency used together # with vertex arrays (3-4-2011) elif search( "V9800", glRenderer): vertexArrays = OFF elif search("Radeon", glRenderer, IGNORECASE): translucencyMode = 2 if search("Mobility", glRenderer, IGNORECASE): displayLists = OFF vertexArrays = OFF # This is the renderer reported (on some systems) for the # ATI Mobility FireGL V5700. if search("Mobility Radeon HD 3650", glRenderer, IGNORECASE): displayLists = ON # On the system that reported the card correctly, could not use display lists # and HAD TO use vertex arrays # Other V5xxx cards also needed vertex arrays elif search("FireGL V5", glRenderer): vertexArrays = ON if search("FireGL V5200", glRenderer): import os os.environ['ABAQUS_ISVIS_THRESHOLD'] = "0" if search("FireGL V5700", glRenderer): hardwareOverlay = OFF highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) if search("Fire GL ",glRenderer) : if search("Fire GL T2",glRenderer) : if displayingToWindows: if glVersion == (1, 5, '.4519'): # Hardware overlay comes out 2X wide with this version: # Version (1, 5, '.4650') [a.k.a. 6.14.10.6483] seems to be fine. hardwareOverlay = OFF highlightMethodHint = ( XOR, SOFTWARE_OVERLAY, BLEND ) else: polygonOffsetConstant = 0.5 polygonOffsetSlope = 1.5 elif search("Fire GL X1",glRenderer) or \ search("Fire GL Z1",glRenderer) : if displayingToWindows: if hardwareOverlay != OFF: highlightMethodHint = ( HARDWARE_OVERLAY, XOR, SOFTWARE_OVERLAY, BLEND ) else: highlightMethodHint = ( XOR, SOFTWARE_OVERLAY, BLEND ) elif search("Fire GL 8x00",glRenderer) : polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.5 elif search("Fire GL8800",glRenderer) : # Avoid H/W Overaly for glVersion: (1, 3, '.3035') # "Fire GL8800 DDR Pentium 4 (SSE2)" hardwareOverlay = OFF highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) # elif glRenderer[:12] == "FireGL V7350": # Driver (2, 0, '.5648') has static lighting # in dynamic view manipulations # H/W overlay is only a problem if window goes off screen # (or at least off the canvas area). It is being left ON # as most users would rather have the benefits. # hardwareOverlay = OFF elif glRenderer == "RAGE 128 Pro x86/SSE": # For glVersion: (1, 2, '.1652 Win2000 Release') polygonOffsetConstant = 0.75 polygonOffsetSlope = 1.7 elif glVendor == "Compaq": if glRenderer == "PBXGD-AD": # For glVersion: (1, 1, None) polygonOffsetConstant = 0.94 elif glVendor == "Diamond Multimedia": if glRenderer == "Fire GL1": # For glVersion: (1, 2, '.1118') vertexArrays = OFF polygonOffsetConstant = 0.5 polygonOffsetSlope = 0.5 elif glVendor == "ELSA": if glRenderer == "ELSA ERAZOR X": polygonOffsetConstant = 1.0 polygonOffsetSlope = 0.55 elif glRenderer == "ELSA Synergy II": # Settings derived running Windows NT 4.0 polygonOffsetConstant = 0.24 polygonOffsetSlope = 0.85 elif glVendor == "Hewlett-Packard Company": if glRenderer == "hpvisfx": polygonOffsetConstant = 0.88 polygonOffsetSlope = 0.9 elif glRenderer == "lib35acda30": # HPUX with Visualize fx-10 card polygonOffsetConstant = 0.97 polygonOffsetSlope = 0.5 # Using texture on the FX10 card can cause problems # when printing but it is a very special case. # For 'glversion' of (1, 1, 'Revision 1.31') printTextureMapping = OFF elif glRenderer == "libddvisxgl": # HPUX with Visualize fx-4 card polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.5 # For 'glversion' of (1, 1, 'Revision 1.32') # because using textures disables polygon offset textureMapping = OFF elif glRenderer == 'Virtual Memory Driver': # This software OpenGL driver will cause /CAE to crash # if we try to use hardware overlays hardwareOverlay = OFF highlightMethodHint = SOFTWARE_OVERLAY elif glVendor == "Intel": antiAlias = OFF # Found with glRenderer == "Intel 965/963 Graphics Media Accelerator" # glVersion == (1, 5, '.0 - Build 6.14.10.4860') highlightMethodHint = ( HARDWARE_OVERLAY, XOR, SOFTWARE_OVERLAY, BLEND ) if glRenderer == "Intel 945GM": # found with glVersion == (1, 4, '.0 - Build 4.14.10.4446) displayLists = OFF backingStore = OFF elif glRenderer == "Intel Cantiga": highlightMethodHint = ( HARDWARE_OVERLAY, SOFTWARE_OVERLAY, XOR, BLEND ) vertexArraysInDisplayLists = OFF elif glRenderer[32] == "Mobile Intel(R) 4 Series Express": highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) hardwareAcceleration = OFF elif glVendor == "Intergraph Corporation": if glRenderer[:6] == "wcgdrv": # found with glRenderer == 'wcgdrv 06.05.06.18' accelerateOffScreen = OFF elif glVendor == "NVIDIA Corporation": if not displayingToWindows: # For any NVIDIA driver on Linux import os os.environ['ABAQUS_DISABLE_FPE'] = "ON" if glxServerVendor == "NVIDIA Corporation": # Problem with writing animation with multiple linked viewports # that have translucent elements. accelerateOffScreen = OFF if glRenderer[:14] == "Quadro FX 4600" or \ glRenderer[:14] == "Quadro FX 1700" or \ glRenderer[:13] == "Quadro FX 580" or \ glRenderer[:13] == "Quadro FX 570" or \ glRenderer[:13] == "Quadro FX 370": polygonOffsetConstant = 1.0 elif glRenderer[:14] == "Quadro FX 3500": # For glVersion: (2, 1, '.2 NVIDIA 169.12') backingStore = OFF elif glRenderer[:14] == "Quadro FX 880M": # tested win86_32 XP glVersion: (3, 1, 'NVIDIA 189.55') translucencyMode = 3 elif glRenderer[:11] == "Quadro2 Pro": polygonOffsetConstant = 2.5 polygonOffsetSlope = 1.7 elif glRenderer[:15] == "Quadro4 750 XGL": polygonOffsetConstant = 1.5 polygonOffsetSlope = 1.0 if glRenderer == "Quadro4 750 XGL/AGP/SSE2" and \ glVersion == (1, 4, '.1 NVIDIA 53.36'): visualId = 0x35 elif glRenderer[:15] == "GeForce": # At least for "GeForce FX 5200" backingStore = OFF # If some mesh facets are missing, try this #if glRenderer[:7] == "Quadro2": #backfaceCulling = OFF elif displayingToWindows: if glRenderer[:9] == "Quadro FX" or \ glRenderer[:7] == "Quadro4" or \ glRenderer[:7] == "Quadro2": # The Quadro FX is OK for Probe but breaks for Printing to printer. accelerateOffScreen = OFF if glRenderer[:14] == "Quadro FX 4600": polygonOffsetConstant = 1.5 elif glRenderer[:14] == "Quadro FX 1300": backingStore = OFF elif glRenderer[:14] == "Quadro FX 570M": translucencyMode = 3 polygonOffsetConstant = 2.0 elif glRenderer[:14] == "Quadro FX 880M": # tested win86_32 XP glVersion: (3, 1, 'NVIDIA 189.55') translucencyMode = 3 elif glRenderer[:11] == "Quadro2 Pro": vertexArrays = OFF if glRenderer[:13] == "Quadro FX 570": import platform if platform.architecture()[0] == '64bit': polygonOffsetConstant = 1.0 elif glRenderer[:12] == "Quadro 1000M": translucencyMode = 3 elif glRenderer[:10] == "Quadro NVS": accelerateOffScreen = OFF antiAlias = OFF translucencyMode = 2 elif glRenderer[:11] == "Quadro2 MXR": if displayingToWindows: highlightMethodHint = ( XOR, SOFTWARE_OVERLAY, BLEND ) polygonOffsetConstant = 1.0 polygonOffsetSlope = 0.5 if glVersion == (1, 2, None): polygonOffsetSlope = 1.0 # v63_2023 Problem with version 6.13.10.2832 from nVidia # FYI: Version 5.13.01.1570 from HP works fine # and has 'glversion' of (1, 2, '.2') if glRenderer == "Quadro2 MXR/AGP/SSE2": vertexArraysInDisplayLists = OFF else: displayLists = OFF else: polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.9 # for glVersion: (1, 4, '.0 NVIDIA 43.63') vertexArrays = OFF # for glVersion: (1, 5, '.3 NVIDIA 76.76') and 78.81 # and glRenderer: Quadro2 MXR/AGP/SSE backingStore = OFF elif glRenderer == "GeForce 256/PCI/SSE": # Elsa Erazor X graphics card # For glVersion: (1, 2, '.1') polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.5 elif glRenderer == "RIVA TNT (PCI)": polygonOffsetConstant = 0.50 polygonOffsetSlope = 1.970 elif glRenderer[9] == "RIVA TNT2": # Settings derived on an Elsa Synergy II card on W2K # For glVersion: (1, 2, '.2') polygonOffsetConstant = 1.0 polygonOffsetSlope = 0.85 # Settings derived for AGP with glVersion: (1, 4, '.0') accelerateOffScreen = OFF elif glVendor == "SGI": if glRenderer[:6] == "IMPACT": polygonOffsetConstant = 1.0 polygonOffsetSlope = 0.85 textureMapping = OFF # Infinite Reality II elif glRenderer == "RES/S/1/2": polygonOffsetConstant = 1.0 # off-screen printing only works without textures elif glRenderer == "VPRO/B/128": textureMapping = OFF elif glVendor == "Sun Microsystems, Inc.": # We know that the following glRenderer strings identify # broken drivers. If we find one that works we can turn # vertex arrays back on for that one # "Elite-3D, VIS" Version: "1.2 Sun OpenGL 1.2.1 for Solaris" # "Creator-3D, VIS" Version: "1.2 Sun OpenGL 1.2.1 for Solaris" vertexArrays = OFF # Some old Sun machines have problems dragging canvas text # annotations. Turning OFF hardwareOverlay will avoid the # problem. Since it is only old machines and there is nothing # in the glRenderer string to identify those machines, we # do not automate turning off hardware overlay. In specific, # the Sun Ultra-2 machines have the problem. #hardwareOverlay = OFF if glRenderer == "XVR-1200, VIS": # Avoid H/W Overaly for glVersion: (1, 2, 'Sun OpenGL 1.2.3 patch 112628-12 for Solaris) hardwareOverlay = OFF highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) elif glVendor == "Brian Paul": if glRenderer == "Mesa X11" or \ glRenderer == "Mesa OffScreen": if glVersion == (1, 2, 'Mesa 3.4.2'): polygonOffsetConstant = 0.08 else: # For glVersion (1, 5, 'Mesa 6.0.1') import uti if uti.getPlatform() == 'lnx86_64': displayLists = OFF polygonOffsetConstant = 50.0 else: polygonOffsetConstant = 35.0 polygonOffsetSlope = 1.125 accelerateOffScreen = OFF if glRenderer[:4] == "Mesa": highlightMethodHint = ( XOR, SOFTWARE_OVERLAY, BLEND ) import os if not os.environ.has_key('ABQ_QA_PRINT'): antiAlias = OFF if glVersion[0] == 1 and glVersion[1] < 5: # The following environment variable must be set to work around a # bug in the mesa implementation prior to mesa version 6.0. Unfortunatly # by the time this code is run it is too late. You will need to add # the following two lines to the abaqus_v6.env file: os.environ['MESA_NO_ASM'] = "1" if glRenderer == "Mesa GLX Indirect": if glVendor == "Mesa project: www.mesa3d.org": # For glVersion == (1, 2, '(1.5 Mesa 6.2.1)') # and glVersion == (1, 2, '(1.5 Mesa 6.4.1)') if glVersion[0] == 1 and glVersion[1] == 2 and \ glVersion[2][:11] == "(1.5 Mesa 6": highlightMethodHint = ( SOFTWARE_OVERLAY, XOR, BLEND ) polygonOffsetConstant = 1.0 backingStore = OFF elif glVendor == "VA Linux Systems, Inc.": # For glVersion: (1, 2, 'Mesa 3.4') polygonOffsetConstant = 0.5 polygonOffsetSlope = 1.27 displayLists = OFF # Color problems after a while # Determine print polygon offset values if glxServerVendor == None and \ glRenderer[:4] != "Mesa": if glRenderer == "GDI Generic": antiAlias = OFF # values for software renderer of Windows XP printPolygonOffsetConstant = 1.0 printPolygonOffsetSlope = 0.75 # Use these defaults for earlier releases of Windows if glxServerVersion[0] != None: if glxServerVersion[0] <= 4 or \ ( glxServerVersion[0] == 5 and glxServerVersion[1] < 1 ): polygonOffsetConstant = 1.0 polygonOffsetSlope = 1.712 else: # values taken from selected display values printPolygonOffsetConstant = polygonOffsetConstant printPolygonOffsetSlope = polygonOffsetSlope if( OFF == textureMapping ): printTextureMapping = OFF # If display lists are OFF, we will set the drag mode to FAST for # performance reasons. For mesh display only, if display lists are # OFF and dragMode is FAST, we draw only "feature edges" helping perf if( OFF == displayLists ): dragMode = FAST session.defaultGraphicsOptions.setValues( graphicsDriver = graphicsDriver, doubleBuffering = doubleBuffering, backfaceCulling = backfaceCulling, displayLists = displayLists, highlightMethodHint = highlightMethodHint, dragMode = dragMode, autoFitAfterRotate = autoFitAfterRotate, antiAlias = antiAlias, translucencyMode = translucencyMode, polygonOffsetConstant = polygonOffsetConstant, polygonOffsetSlope = polygonOffsetSlope, printPolygonOffsetConstant = printPolygonOffsetConstant, printPolygonOffsetSlope = printPolygonOffsetSlope, vertexArrays = vertexArrays, vertexArraysInDisplayLists = vertexArraysInDisplayLists, textureMapping = textureMapping, printTextureMapping = printTextureMapping, contourRangeTexturePrecision = contourRangeTexturePrecision, directRendering = directRendering, hardwareAcceleration = hardwareAcceleration, accelerateOffScreen = accelerateOffScreen, hardwareOverlay = hardwareOverlay, backgroundColor = backgroundColor, backingStore = backingStore, _visualId = visualId )