Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GraphicsStateGuardian Class Reference

Encapsulates all the communication with a particular instance of a given rendering backend. More...

Inheritance diagram for GraphicsStateGuardian:
GraphicsStateGuardianBase TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject

Public Types

enum  ShaderModel {
  SM_00 = 0, SM_11 = 1, SM_20 = 2, SM_2X = 3,
  SM_30 = 4, SM_40 = 5, SM_50 = 6, SM_51 = 7
}
 

Public Member Functions

bool beginScene ()
 
 clearFlashTexture ()
 
 endScene ()
 
bool getAlphaScaleViaTexture ()
 Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha. More...
 
bool getAlphaScaleViaTexture (const TextureAttrib tex_attrib)
 This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect. More...
 
bool getColorScaleViaLighting ()
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color. More...
 
CoordinateSystem getCoordinateSystem ()
 Returns the coordinate system in effect on this particular gsg. More...
 
bool getCopyTextureInverted ()
 Returns true if this particular GSG has the property that any framebuffer- to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down. More...
 
str getDriverRenderer ()
 
int getDriverShaderVersionMajor ()
 
int getDriverShaderVersionMinor ()
 
str getDriverVendor ()
 
str getDriverVersion ()
 
int getDriverVersionMajor ()
 
int getDriverVersionMinor ()
 
GraphicsEngine getEngine ()
 
Texture getFlashTexture ()
 
float getGamma ()
 
CoordinateSystem getInternalCoordinateSystem ()
 
Loader getLoader ()
 Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true. More...
 
int getMax2dTextureArrayLayers ()
 Returns the largest possible number of pages, or -1 if there is no particular limit. More...
 
int getMax3dTextureDimension ()
 Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit. More...
 
int getMaxBufferTextureSize ()
 Returns the largest possible buffer texture size, or -1 if there is no particular limit. More...
 
int getMaxClipPlanes ()
 Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit. More...
 
int getMaxColorTargets ()
 Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG. More...
 
int getMaxCubeMapDimension ()
 Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit. More...
 
int getMaximumSimultaneousRenderTargets ()
 Deprecated. More...
 
int getMaxLights ()
 Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit. More...
 
int getMaxTextureStages ()
 Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG. More...
 
int getMaxVertexTransformIndices ()
 Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware. More...
 
int getMaxVertexTransforms ()
 Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware. More...
 
GraphicsPipe getPipe ()
 Returns the graphics pipe on which this GSG was created. More...
 
PreparedGraphicsObjects getPreparedObjects ()
 
object getPreparedTextures ()
 
bool getRuntimeColorScale ()
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting. More...
 
SceneSetup getScene ()
 
ShaderGenerator getShaderGenerator ()
 Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary. More...
 
GraphicsStateGuardian::ShaderModel getShaderModel ()
 Returns the ShaderModel. More...
 
bool getSupports2dTextureArray ()
 Returns true if this GSG can render 2-d textures array. More...
 
bool getSupports3dTexture ()
 Returns true if this GSG can render 3-d (volumetric) textures. More...
 
bool getSupportsBasicShaders ()
 Returns true if this particular GSG supports arbfp1+arbvp1 or above. More...
 
bool getSupportsBufferTexture ()
 Returns true if this GSG can render buffer textures. More...
 
bool getSupportsCgProfile (str name)
 
bool getSupportsCompressedTexture ()
 Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing. More...
 
bool getSupportsComputeShaders ()
 Returns true if this particular GSG supports compute shaders. More...
 
bool getSupportsCubeMap ()
 Returns true if this GSG can render cube map textures. More...
 
bool getSupportsCubeMapArray ()
 Returns true if this GSG can render cube map arrays. More...
 
bool getSupportsDepthStencil ()
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool getSupportsDepthTexture ()
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool getSupportsDualSourceBlending ()
 Returns true if dual source (incoming1_color and incoming1_alpha) blend operands are supported by this GSG. More...
 
bool getSupportsGenerateMipmap ()
 Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software. More...
 
bool getSupportsGeometryInstancing ()
 Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model. More...
 
bool getSupportsGeometryShaders ()
 Returns true if this particular GSG supports geometry shaders. More...
 
bool getSupportsGlsl ()
 Returns true if this particular GSG supports GLSL shaders. More...
 
bool getSupportsIndirectDraw ()
 Returns true if this particular GSG supports draw calls for which the information comes from a buffer. More...
 
bool getSupportsLuminanceTexture ()
 Returns true if this particular GSG supports luminance textures. More...
 
bool getSupportsOcclusionQuery ()
 Returns true if this GSG supports an occlusion query. More...
 
bool getSupportsSamplerObjects ()
 Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects. More...
 
bool getSupportsStencil ()
 Returns true if this particular GSG supports stencil buffers at all. More...
 
bool getSupportsTessellationShaders ()
 Returns true if this particular GSG supports tesselation shaders. More...
 
bool getSupportsTexNonPow2 ()
 Returns true if this GSG can handle non power of two sized textures. More...
 
bool getSupportsTextureCombine ()
 Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha(). More...
 
bool getSupportsTextureDot3 ()
 Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes. More...
 
bool getSupportsTextureSavedResult ()
 Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs. More...
 
bool getSupportsTimerQuery ()
 Returns true if this GSG supports a timer query. More...
 
bool getSupportsTwoSidedStencil ()
 Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon. More...
 
Texture::QualityLevel getTextureQualityOverride ()
 Returns the global quality_level override specified by set_texture_quality_override. More...
 
const GraphicsThreadingModel getThreadingModel ()
 Returns the threading model that was used to create this GSG. More...
 
bool getTimerQueriesActive ()
 Returns true if timer queries are currently enabled on this GSG. More...
 
bool hasExtension (str extension)
 
bool isActive ()
 Returns the active flag associated with the GraphicsStateGuardian. More...
 
bool isHardware ()
 Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only. More...
 
bool isValid ()
 Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet. More...
 
bool needsReset ()
 Returns true if the gsg is marked as needing a reset. More...
 
 releaseAll ()
 Releases all prepared objects. More...
 
int releaseAllGeoms ()
 Frees the resources for all geoms associated with this GSG. More...
 
int releaseAllIndexBuffers ()
 Frees the resources for all index buffers associated with this GSG. More...
 
int releaseAllSamplers ()
 Frees the resources for all samplers associated with this GSG. More...
 
int releaseAllShaderBuffers ()
 Frees the resources for all index buffers associated with this GSG. More...
 
int releaseAllTextures ()
 Frees the resources for all textures associated with this GSG. More...
 
int releaseAllVertexBuffers ()
 Frees the resources for all vertex buffers associated with this GSG. More...
 
 restoreGamma ()
 
 setActive (bool active)
 Sets the active flag associated with the GraphicsStateGuardian. More...
 
 setCoordinateSystem (CoordinateSystem cs)
 
 setFlashTexture (Texture tex)
 
bool setGamma (float gamma)
 
 setIncompleteRender (bool incomplete_render)
 Sets the incomplete_render flag. More...
 
 setLoader (Loader loader)
 Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true. More...
 
bool setScene (SceneSetup scene_setup)
 
 setShaderGenerator (ShaderGenerator shader_generator)
 Sets the ShaderGenerator object that will be used by this GSG to generate shaders when necessary. More...
 
 setShaderModel (GraphicsStateGuardian::ShaderModel shader_model)
 Sets the ShaderModel. More...
 
 setTextureQualityOverride (Texture::QualityLevel quality_level)
 Specifies the global quality_level to be imposed for all Textures rendered by this GSG. More...
 
- Public Member Functions inherited from GraphicsStateGuardianBase
bool getEffectiveIncompleteRender ()
 
list getGsgs ()
 
bool getIncompleteRender ()
 
int getMaxTextureDimension ()
 
int getMaxVerticesPerArray ()
 
int getMaxVerticesPerPrimitive ()
 
int getSupportedGeomRendering ()
 
bool getSupportsCompressedTextureFormat (int compression_mode)
 
bool getSupportsHlsl ()
 
bool getSupportsMultisample ()
 
bool getSupportsShadowFilter ()
 
bool getSupportsTextureSrgb ()
 
bool prefersTriangleStrips ()
 
- Public Member Functions inherited from TypedWritable
object __reduce__ ()
 
object __reduce_persist__ (object pickler)
 
VectorUchar encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More...
 
bool encodeToBamStream (VectorUchar data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
 fillin (DatagramIterator scan, BamReader manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More...
 
UpdateSeq getBamModified ()
 Returns the current bam_modified counter. More...
 
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

static TextureStage getAlphaScaleTextureStage ()
 Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true. More...
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from GraphicsStateGuardianBase
static TypeHandle getClassType ()
 
static GraphicsStateGuardianBase getDefaultGsg ()
 Returns a pointer to the "default" GSG. More...
 
static GraphicsStateGuardianBase getGsg (int n)
 Returns the nth GSG in the universe. More...
 
static int getNumGsgs ()
 Returns the total number of GSG's in the universe. More...
 
static setDefaultGsg (GraphicsStateGuardianBase default_gsg)
 Specifies a particular GSG to use as the "default" GSG. More...
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypedWritableReferenceCount decodeFromBamStream (VectorUchar data, BamReader reader)
 Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on those bytes. More...
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritable
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Public Attributes

bool active
 Returns the active flag associated with the GraphicsStateGuardian. More...
 
CoordinateSystem coordinate_system
 Returns the coordinate system in effect on this particular gsg. More...
 
bool copy_texture_inverted
 Returns true if this particular GSG has the property that any framebuffer- to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down. More...
 
String driver_renderer
 
int driver_shader_version_major
 
int driver_shader_version_minor
 
String driver_vendor
 
String driver_version
 
int driver_version_major
 
int driver_version_minor
 
bool effective_incomplete_render
 Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags. More...
 
Texture flash_texture
 
float gamma
 
bool incomplete_render
 Returns the incomplete_render flag. More...
 
Loader loader
 Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true. More...
 
int max_2d_texture_array_layers
 z axis More...
 
int max_3d_texture_dimension
 Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit. More...
 
int max_buffer_texture_size
 Returns the largest possible buffer texture size, or -1 if there is no particular limit. More...
 
int max_clip_planes
 Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit. More...
 
int max_color_targets
 Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG. More...
 
int max_cube_map_dimension
 z axis More...
 
int max_lights
 Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit. More...
 
int max_texture_dimension
 Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit. More...
 
int max_texture_stages
 Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG. More...
 
int max_vertex_transform_indices
 Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware. More...
 
int max_vertex_transforms
 Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware. More...
 
int max_vertices_per_array
 Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG. More...
 
int max_vertices_per_primitive
 Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG. More...
 
GraphicsPipe pipe
 Returns the graphics pipe on which this GSG was created. More...
 
PreparedGraphicsObjects prepared_objects
 
SceneSetup scene
 
ShaderGenerator shader_generator
 Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary. More...
 
GraphicsStateGuardian::ShaderModel shader_model
 Returns the ShaderModel. More...
 
bool supports_2d_texture_array
 Returns true if this GSG can render 2-d textures array. More...
 
bool supports_3d_texture
 Returns true if this GSG can render 3-d (volumetric) textures. More...
 
bool supports_basic_shaders
 Returns true if this particular GSG supports arbfp1+arbvp1 or above. More...
 
bool supports_buffer_texture
 Returns true if this GSG can render buffer textures. More...
 
bool supports_compressed_texture
 Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing. More...
 
bool supports_compute_shaders
 Returns true if this particular GSG supports compute shaders. More...
 
bool supports_cube_map
 Returns true if this GSG can render cube map textures. More...
 
bool supports_cube_map_array
 Returns true if this GSG can render cube map arrays. More...
 
bool supports_depth_stencil
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool supports_depth_texture
 Returns true if this particular GSG supports textures whose format is F_depth_stencil. More...
 
bool supports_dual_source_blending
 Returns true if dual source (incoming1_color and incoming1_alpha) blend operands are supported by this GSG. More...
 
bool supports_generate_mipmap
 Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software. More...
 
bool supports_geometry_instancing
 Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model. More...
 
bool supports_geometry_shaders
 Returns true if this particular GSG supports geometry shaders. More...
 
bool supports_glsl
 Returns true if this particular GSG supports GLSL shaders. More...
 
bool supports_hlsl
 Returns true if this particular GSG supports HLSL shaders. More...
 
bool supports_indirect_draw
 Returns true if this particular GSG supports draw calls for which the information comes from a buffer. More...
 
bool supports_luminance_texture
 Returns true if this particular GSG supports luminance textures. More...
 
bool supports_multisample
 
bool supports_occlusion_query
 Returns true if this GSG supports an occlusion query. More...
 
bool supports_sampler_objects
 Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects. More...
 
bool supports_shadow_filter
 Returns true if this particular GSG supports the filter mode FT_shadow for depth textures. More...
 
bool supports_stencil
 Returns true if this particular GSG supports stencil buffers at all. More...
 
bool supports_tessellation_shaders
 Returns true if this particular GSG supports tesselation shaders. More...
 
bool supports_tex_non_pow2
 Returns true if this GSG can handle non power of two sized textures. More...
 
bool supports_texture_combine
 Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha(). More...
 
bool supports_texture_dot3
 Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes. More...
 
bool supports_texture_saved_result
 Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs. More...
 
bool supports_texture_srgb
 Returns true if this GSG can handle sRGB textures. More...
 
bool supports_timer_query
 Returns true if this GSG supports a timer query. More...
 
bool supports_two_sided_stencil
 Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon. More...
 
Texture::QualityLevel texture_quality_override
 Returns the global quality_level override specified by set_texture_quality_override. More...
 
bool timer_queries_active
 Returns true if timer queries are currently enabled on this GSG. More...
 
bool valid
 Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet. More...
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

Detailed Description

Encapsulates all the communication with a particular instance of a given rendering backend.

Tries to guarantee that redundant state-change requests are not issued (hence "state guardian").

There will be one of these objects for each different graphics context active in the system.

Member Enumeration Documentation

◆ ShaderModel

Enumerator
SM_00 
SM_11 
SM_20 
SM_2X 
SM_30 
SM_40 
SM_50 
SM_51 

Member Function Documentation

◆ beginScene()

bool beginScene ( )

◆ clearFlashTexture()

clearFlashTexture ( )

◆ endScene()

endScene ( )

◆ getAlphaScaleTextureStage()

static TextureStage getAlphaScaleTextureStage ( )
static

Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true.

◆ getAlphaScaleViaTexture() [1/2]

bool getAlphaScaleViaTexture ( )

Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha.

◆ getAlphaScaleViaTexture() [2/2]

bool getAlphaScaleViaTexture ( const TextureAttrib  tex_attrib)

This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect.

This considers whether there is at least one additional texture slot available on the GSG.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getColorScaleViaLighting()

bool getColorScaleViaLighting ( )

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color.

◆ getCoordinateSystem()

CoordinateSystem getCoordinateSystem ( )

Returns the coordinate system in effect on this particular gsg.

Normally, this will be the default coordinate system, but it might be set differently at runtime.

◆ getCopyTextureInverted()

bool getCopyTextureInverted ( )

Returns true if this particular GSG has the property that any framebuffer- to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down.

If this is true, then on offscreen GraphicsBuffer created for the purposes of rendering into a texture should be created with the invert flag set true, to compensate. Panda will do this automatically if you create an offscreen buffer using GraphicsOutput::make_texture_buffer().

◆ getDriverRenderer()

str getDriverRenderer ( )

◆ getDriverShaderVersionMajor()

int getDriverShaderVersionMajor ( )

◆ getDriverShaderVersionMinor()

int getDriverShaderVersionMinor ( )

◆ getDriverVendor()

str getDriverVendor ( )

◆ getDriverVersion()

str getDriverVersion ( )

◆ getDriverVersionMajor()

int getDriverVersionMajor ( )

◆ getDriverVersionMinor()

int getDriverVersionMinor ( )

◆ getEngine()

GraphicsEngine getEngine ( )

◆ getFlashTexture()

Texture getFlashTexture ( )

◆ getGamma()

float getGamma ( )

◆ getInternalCoordinateSystem()

CoordinateSystem getInternalCoordinateSystem ( )

◆ getLoader()

Loader getLoader ( )

Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

◆ getMax2dTextureArrayLayers()

int getMax2dTextureArrayLayers ( )

Returns the largest possible number of pages, or -1 if there is no particular limit.

Returns 0 if 2-d texture arrays not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMax3dTextureDimension()

int getMax3dTextureDimension ( )

Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit.

Returns 0 if 3-d textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxBufferTextureSize()

int getMaxBufferTextureSize ( )

Returns the largest possible buffer texture size, or -1 if there is no particular limit.

Returns 0 if cube map textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxClipPlanes()

int getMaxClipPlanes ( )

Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxColorTargets()

int getMaxColorTargets ( )

Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG.

If you exceed this number, the lowest-priority render targets will not be applied. Use RenderTarget::set_priority() to adjust the relative importance of the different render targets.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxCubeMapDimension()

int getMaxCubeMapDimension ( )

Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit.

Returns 0 if cube map textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaximumSimultaneousRenderTargets()

int getMaximumSimultaneousRenderTargets ( )

Deprecated.

Use get_max_color_targets() instead, which returns the exact same value.

◆ getMaxLights()

int getMaxLights ( )

Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxTextureStages()

int getMaxTextureStages ( )

Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG.

If you exceed this number, the lowest-priority texture stages will not be applied. Use TextureStage::set_priority() to adjust the relative importance of the different texture stages.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxVertexTransformIndices()

int getMaxVertexTransformIndices ( )

Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware.

If this number is 0 (but get_max_transforms() is nonzero), then the graphics hardware (or API) doesn't support indexed transforms, but can support direct transform references.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getMaxVertexTransforms()

int getMaxVertexTransforms ( )

Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware.

If this number is 0, then the hardware (or the graphics backend) doesn't support soft- skinned vertices (in which case Panda will animate the vertices in software).

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ getPipe()

GraphicsPipe getPipe ( )

Returns the graphics pipe on which this GSG was created.

◆ getPreparedObjects()

PreparedGraphicsObjects getPreparedObjects ( )

◆ getPreparedTextures()

object getPreparedTextures ( )

◆ getRuntimeColorScale()

bool getRuntimeColorScale ( )

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting.

◆ getScene()

SceneSetup getScene ( )

◆ getShaderGenerator()

ShaderGenerator getShaderGenerator ( )

Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.

◆ getShaderModel()

Returns the ShaderModel.

◆ getSupports2dTextureArray()

bool getSupports2dTextureArray ( )

Returns true if this GSG can render 2-d textures array.

◆ getSupports3dTexture()

bool getSupports3dTexture ( )

Returns true if this GSG can render 3-d (volumetric) textures.

◆ getSupportsBasicShaders()

bool getSupportsBasicShaders ( )

Returns true if this particular GSG supports arbfp1+arbvp1 or above.

◆ getSupportsBufferTexture()

bool getSupportsBufferTexture ( )

Returns true if this GSG can render buffer textures.

◆ getSupportsCgProfile()

bool getSupportsCgProfile ( str  name)

◆ getSupportsCompressedTexture()

bool getSupportsCompressedTexture ( )

Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing.

◆ getSupportsComputeShaders()

bool getSupportsComputeShaders ( )

Returns true if this particular GSG supports compute shaders.

◆ getSupportsCubeMap()

bool getSupportsCubeMap ( )

Returns true if this GSG can render cube map textures.

◆ getSupportsCubeMapArray()

bool getSupportsCubeMapArray ( )

Returns true if this GSG can render cube map arrays.

◆ getSupportsDepthStencil()

bool getSupportsDepthStencil ( )

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This only returns true if the GSG supports the full packed depth-stencil functionality.

◆ getSupportsDepthTexture()

bool getSupportsDepthTexture ( )

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This returns true if the GSG supports GL_DEPTH_COMPONENT textures, which are considered a limited but still valid case of F_depth_stencil.

◆ getSupportsDualSourceBlending()

bool getSupportsDualSourceBlending ( )

Returns true if dual source (incoming1_color and incoming1_alpha) blend operands are supported by this GSG.

◆ getSupportsGenerateMipmap()

bool getSupportsGenerateMipmap ( )

Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software.

If this is true, then mipmaps can safely be enabled for rendered textures (e.g. using the MultitexReducer).

◆ getSupportsGeometryInstancing()

bool getSupportsGeometryInstancing ( )

Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model.

In OpenGL, this is done using the EXT_draw_instanced extension.

◆ getSupportsGeometryShaders()

bool getSupportsGeometryShaders ( )

Returns true if this particular GSG supports geometry shaders.

◆ getSupportsGlsl()

bool getSupportsGlsl ( )

Returns true if this particular GSG supports GLSL shaders.

◆ getSupportsIndirectDraw()

bool getSupportsIndirectDraw ( )

Returns true if this particular GSG supports draw calls for which the information comes from a buffer.

◆ getSupportsLuminanceTexture()

bool getSupportsLuminanceTexture ( )

Returns true if this particular GSG supports luminance textures.

◆ getSupportsOcclusionQuery()

bool getSupportsOcclusionQuery ( )

Returns true if this GSG supports an occlusion query.

If this is true, then begin_occlusion_query() and end_occlusion_query() may be called to bracket a sequence of draw_triangles() (or whatever) calls to measure pixels that pass the depth test.

◆ getSupportsSamplerObjects()

bool getSupportsSamplerObjects ( )

Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects.

This doesn't really affect functionality, but if this is false, it may mean that using the same texture with different SamplerState objects will result in reduced performance.

◆ getSupportsStencil()

bool getSupportsStencil ( )

Returns true if this particular GSG supports stencil buffers at all.

◆ getSupportsTessellationShaders()

bool getSupportsTessellationShaders ( )

Returns true if this particular GSG supports tesselation shaders.

◆ getSupportsTexNonPow2()

bool getSupportsTexNonPow2 ( )

Returns true if this GSG can handle non power of two sized textures.

◆ getSupportsTextureCombine()

bool getSupportsTextureCombine ( )

Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha().

If this is false, you must limit yourself to using the simpler blend modes.

◆ getSupportsTextureDot3()

bool getSupportsTextureDot3 ( )

Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.

◆ getSupportsTextureSavedResult()

bool getSupportsTextureSavedResult ( )

Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs.

◆ getSupportsTimerQuery()

bool getSupportsTimerQuery ( )

Returns true if this GSG supports a timer query.

◆ getSupportsTwoSidedStencil()

bool getSupportsTwoSidedStencil ( )

Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon.

◆ getTextureQualityOverride()

Texture::QualityLevel getTextureQualityOverride ( )

Returns the global quality_level override specified by set_texture_quality_override.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

◆ getThreadingModel()

const GraphicsThreadingModel getThreadingModel ( )

Returns the threading model that was used to create this GSG.

◆ getTimerQueriesActive()

bool getTimerQueriesActive ( )

Returns true if timer queries are currently enabled on this GSG.

◆ hasExtension()

bool hasExtension ( str  extension)

◆ isActive()

bool isActive ( )

Returns the active flag associated with the GraphicsStateGuardian.

◆ isHardware()

bool isHardware ( )

Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only.

◆ isValid()

bool isValid ( )

Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet.

◆ needsReset()

bool needsReset ( )

Returns true if the gsg is marked as needing a reset.

◆ releaseAll()

releaseAll ( )

Releases all prepared objects.

◆ releaseAllGeoms()

int releaseAllGeoms ( )

Frees the resources for all geoms associated with this GSG.

◆ releaseAllIndexBuffers()

int releaseAllIndexBuffers ( )

Frees the resources for all index buffers associated with this GSG.

◆ releaseAllSamplers()

int releaseAllSamplers ( )

Frees the resources for all samplers associated with this GSG.

◆ releaseAllShaderBuffers()

int releaseAllShaderBuffers ( )

Frees the resources for all index buffers associated with this GSG.

◆ releaseAllTextures()

int releaseAllTextures ( )

Frees the resources for all textures associated with this GSG.

◆ releaseAllVertexBuffers()

int releaseAllVertexBuffers ( )

Frees the resources for all vertex buffers associated with this GSG.

◆ restoreGamma()

restoreGamma ( )

◆ setActive()

setActive ( bool  active)

Sets the active flag associated with the GraphicsStateGuardian.

If the GraphicsStateGuardian is marked inactive, nothing is rendered. This is not normally turned off unless there is a problem with the rendering detected at a low level.

◆ setCoordinateSystem()

setCoordinateSystem ( CoordinateSystem  cs)

◆ setFlashTexture()

setFlashTexture ( Texture  tex)

◆ setGamma()

bool setGamma ( float  gamma)

◆ setIncompleteRender()

setIncompleteRender ( bool  incomplete_render)

Sets the incomplete_render flag.

When this is true, the frame will be rendered even if some of the geometry or textures in the scene are not available (e.g. they have been temporarily paged out). When this is false, the frame will be held up while this data is reloaded.

Setting this true allows for a smoother frame rate, but occasionally parts of the frame will be invisible or missing (they will generally come in within a second or two). Setting this false guarantees that every frame will be complete, but may cause more chugs as things are loaded up at runtime.

You may want to set this false during loading screens, to guarantee that all of your assets are available by the time you take the loading screen down.

This flag may also be set individually on each DisplayRegion. It will be considered true for a given DisplayRegion only if it is true on both the GSG and on the DisplayRegion.

◆ setLoader()

setLoader ( Loader  loader)

Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

◆ setScene()

bool setScene ( SceneSetup  scene_setup)

◆ setShaderGenerator()

setShaderGenerator ( ShaderGenerator  shader_generator)

Sets the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.

◆ setShaderModel()

setShaderModel ( GraphicsStateGuardian::ShaderModel  shader_model)

Sets the ShaderModel.

This will override the auto- detected shader model during GSG reset. Useful for testing lower-end shaders.

◆ setTextureQualityOverride()

setTextureQualityOverride ( Texture::QualityLevel  quality_level)

Specifies the global quality_level to be imposed for all Textures rendered by this GSG.

This overrides the value set on individual textures via Texture::set_quality_level(). Set this to Texture::QL_default in order to allow the individual texture quality levels to be respected.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

Member Data Documentation

◆ active

bool active

Returns the active flag associated with the GraphicsStateGuardian.

◆ coordinate_system

CoordinateSystem coordinate_system

Returns the coordinate system in effect on this particular gsg.

Normally, this will be the default coordinate system, but it might be set differently at runtime.

◆ copy_texture_inverted

bool copy_texture_inverted

Returns true if this particular GSG has the property that any framebuffer- to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down.

If this is true, then on offscreen GraphicsBuffer created for the purposes of rendering into a texture should be created with the invert flag set true, to compensate. Panda will do this automatically if you create an offscreen buffer using GraphicsOutput::make_texture_buffer().

◆ driver_renderer

String driver_renderer

◆ driver_shader_version_major

int driver_shader_version_major

◆ driver_shader_version_minor

int driver_shader_version_minor

◆ driver_vendor

String driver_vendor

◆ driver_version

String driver_version

◆ driver_version_major

int driver_version_major

◆ driver_version_minor

int driver_version_minor

◆ effective_incomplete_render

bool effective_incomplete_render

Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags.

It only makes sense to call this during the draw traversal; at other times this return value will be meaningless.

See CullTraverser::get_effective_incomplete_render() for this same information during the cull traversal.

◆ flash_texture

Texture flash_texture

◆ gamma

float gamma

◆ incomplete_render

bool incomplete_render

Returns the incomplete_render flag.

See set_incomplete_render().

◆ loader

Loader loader

Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

◆ max_2d_texture_array_layers

int max_2d_texture_array_layers

z axis

◆ max_3d_texture_dimension

int max_3d_texture_dimension

Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit.

Returns 0 if 3-d textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_buffer_texture_size

int max_buffer_texture_size

Returns the largest possible buffer texture size, or -1 if there is no particular limit.

Returns 0 if cube map textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_clip_planes

int max_clip_planes

Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_color_targets

int max_color_targets

Returns the maximum number of simultaneous color textures that may be attached for render-to-texture, as supported by this particular GSG.

If you exceed this number, the lowest-priority render targets will not be applied. Use RenderTarget::set_priority() to adjust the relative importance of the different render targets.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_cube_map_dimension

int max_cube_map_dimension

z axis

◆ max_lights

int max_lights

Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_texture_dimension

int max_texture_dimension

Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_texture_stages

int max_texture_stages

Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG.

If you exceed this number, the lowest-priority texture stages will not be applied. Use TextureStage::set_priority() to adjust the relative importance of the different texture stages.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_vertex_transform_indices

int max_vertex_transform_indices

Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware.

If this number is 0 (but get_max_transforms() is nonzero), then the graphics hardware (or API) doesn't support indexed transforms, but can support direct transform references.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_vertex_transforms

int max_vertex_transforms

Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware.

If this number is 0, then the hardware (or the graphics backend) doesn't support soft- skinned vertices (in which case Panda will animate the vertices in software).

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

◆ max_vertices_per_array

int max_vertices_per_array

Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG.

◆ max_vertices_per_primitive

int max_vertices_per_primitive

Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG.

◆ pipe

Returns the graphics pipe on which this GSG was created.

◆ prepared_objects

PreparedGraphicsObjects prepared_objects

◆ scene

SceneSetup scene

◆ shader_generator

ShaderGenerator shader_generator

Returns the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.

◆ shader_model

Returns the ShaderModel.

◆ supports_2d_texture_array

bool supports_2d_texture_array

Returns true if this GSG can render 2-d textures array.

◆ supports_3d_texture

bool supports_3d_texture

Returns true if this GSG can render 3-d (volumetric) textures.

◆ supports_basic_shaders

bool supports_basic_shaders

Returns true if this particular GSG supports arbfp1+arbvp1 or above.

◆ supports_buffer_texture

bool supports_buffer_texture

Returns true if this GSG can render buffer textures.

◆ supports_compressed_texture

bool supports_compressed_texture

Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing.

◆ supports_compute_shaders

bool supports_compute_shaders

Returns true if this particular GSG supports compute shaders.

◆ supports_cube_map

bool supports_cube_map

Returns true if this GSG can render cube map textures.

◆ supports_cube_map_array

bool supports_cube_map_array

Returns true if this GSG can render cube map arrays.

◆ supports_depth_stencil

bool supports_depth_stencil

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This only returns true if the GSG supports the full packed depth-stencil functionality.

◆ supports_depth_texture

bool supports_depth_texture

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This returns true if the GSG supports GL_DEPTH_COMPONENT textures, which are considered a limited but still valid case of F_depth_stencil.

◆ supports_dual_source_blending

bool supports_dual_source_blending

Returns true if dual source (incoming1_color and incoming1_alpha) blend operands are supported by this GSG.

◆ supports_generate_mipmap

bool supports_generate_mipmap

Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software.

If this is true, then mipmaps can safely be enabled for rendered textures (e.g. using the MultitexReducer).

◆ supports_geometry_instancing

bool supports_geometry_instancing

Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model.

In OpenGL, this is done using the EXT_draw_instanced extension.

◆ supports_geometry_shaders

bool supports_geometry_shaders

Returns true if this particular GSG supports geometry shaders.

◆ supports_glsl

bool supports_glsl

Returns true if this particular GSG supports GLSL shaders.

◆ supports_hlsl

bool supports_hlsl

Returns true if this particular GSG supports HLSL shaders.

◆ supports_indirect_draw

bool supports_indirect_draw

Returns true if this particular GSG supports draw calls for which the information comes from a buffer.

◆ supports_luminance_texture

bool supports_luminance_texture

Returns true if this particular GSG supports luminance textures.

◆ supports_multisample

bool supports_multisample

◆ supports_occlusion_query

bool supports_occlusion_query

Returns true if this GSG supports an occlusion query.

If this is true, then begin_occlusion_query() and end_occlusion_query() may be called to bracket a sequence of draw_triangles() (or whatever) calls to measure pixels that pass the depth test.

◆ supports_sampler_objects

bool supports_sampler_objects

Returns true if this particular GSG supports the use of sampler objects to record texture sampling parameters separately from the texture objects.

This doesn't really affect functionality, but if this is false, it may mean that using the same texture with different SamplerState objects will result in reduced performance.

◆ supports_shadow_filter

bool supports_shadow_filter

Returns true if this particular GSG supports the filter mode FT_shadow for depth textures.

◆ supports_stencil

bool supports_stencil

Returns true if this particular GSG supports stencil buffers at all.

◆ supports_tessellation_shaders

bool supports_tessellation_shaders

Returns true if this particular GSG supports tesselation shaders.

◆ supports_tex_non_pow2

bool supports_tex_non_pow2

Returns true if this GSG can handle non power of two sized textures.

◆ supports_texture_combine

bool supports_texture_combine

Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha().

If this is false, you must limit yourself to using the simpler blend modes.

◆ supports_texture_dot3

bool supports_texture_dot3

Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.

◆ supports_texture_saved_result

bool supports_texture_saved_result

Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs.

◆ supports_texture_srgb

bool supports_texture_srgb

Returns true if this GSG can handle sRGB textures.

◆ supports_timer_query

bool supports_timer_query

Returns true if this GSG supports a timer query.

◆ supports_two_sided_stencil

bool supports_two_sided_stencil

Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon.

◆ texture_quality_override

Texture::QualityLevel texture_quality_override

Returns the global quality_level override specified by set_texture_quality_override.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

◆ timer_queries_active

bool timer_queries_active

Returns true if timer queries are currently enabled on this GSG.

◆ valid

bool valid

Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet.