GraphicsStateGuardian¶
-
class GraphicsStateGuardian¶
Bases:
GraphicsStateGuardianBaseEncapsulates 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.
Inheritance diagram
digraph inheritancef71ca24f7e { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "GraphicsStateGuardian" [URL="acron.core.GraphicsStateGuardian.html#acron.core.GraphicsStateGuardian",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "GraphicsStateGuardianBase" -> "GraphicsStateGuardian" [arrowsize=0.75,style=""]; "GraphicsStateGuardianBase" [URL="acron.core.GraphicsStateGuardianBase.html#acron.core.GraphicsStateGuardianBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritableReferenceCount" -> "GraphicsStateGuardianBase" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedWritable" [URL="acron.core.TypedWritable.html#acron.core.TypedWritable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedWritable" [arrowsize=0.75,style=""]; "TypedWritableReferenceCount" [URL="acron.core.TypedWritableReferenceCount.html#acron.core.TypedWritableReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritable" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; }-
enum ShaderModel¶
-
enumerator SM_00 = 0¶
-
enumerator SM_11 = 1¶
-
enumerator SM_20 = 2¶
-
enumerator SM_2X = 3¶
-
enumerator SM_30 = 4¶
-
enumerator SM_40 = 5¶
-
enumerator SM_50 = 6¶
-
enumerator SM_51 = 7¶
-
enumerator SM_00 = 0¶
- GraphicsStateGuardian.begin_scene()¶
- GraphicsStateGuardian.clear_flash_texture()¶
- GraphicsStateGuardian.end_scene()¶
- static GraphicsStateGuardian.get_alpha_scale_texture_stage()¶
Returns the
TextureStagethat will be used to apply an alpha scale, ifget_alpha_scale_via_texture()returns true.
- GraphicsStateGuardian.get_alpha_scale_via_texture()¶
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.
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
TextureAttribthat will be in effect. This considers whether there is at least one additional texture slot available on the GSG.
- static GraphicsStateGuardian.get_class_type()¶
- GraphicsStateGuardian.get_color_scale_via_lighting()¶
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.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_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 Acron’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
GraphicsBuffercreated for the purposes of rendering into a texture should be created with the invert flag set true, to compensate. Acron will do this automatically if you create an offscreen buffer usingGraphicsOutput::make_texture_buffer().
- GraphicsStateGuardian.get_driver_renderer()¶
- GraphicsStateGuardian.get_driver_shader_version_major()¶
- GraphicsStateGuardian.get_driver_shader_version_minor()¶
- GraphicsStateGuardian.get_driver_vendor()¶
- GraphicsStateGuardian.get_driver_version()¶
- GraphicsStateGuardian.get_driver_version_major()¶
- GraphicsStateGuardian.get_driver_version_minor()¶
- GraphicsStateGuardian.get_engine()¶
- GraphicsStateGuardian.get_flash_texture()¶
- GraphicsStateGuardian.get_gamma()¶
- GraphicsStateGuardian.get_internal_coordinate_system()¶
- GraphicsStateGuardian.get_loader()¶
Returns the Loader object that will be used by this GSG to load textures when necessary, if
get_incomplete_render()is true.
- GraphicsStateGuardian.get_max_2d_texture_array_layers()¶
//z axis
//z axis
- /**
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).
*/
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_max_cube_map_dimension()¶
//z axis
//z axis
- /**
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).
*/
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_max_vertex_transform_indices()¶
Returns the maximum number of transforms there may be in a single
TransformTablefor 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).
- GraphicsStateGuardian.get_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 Acron 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).
- GraphicsStateGuardian.get_maximum_simultaneous_render_targets()¶
Deprecated. Use
get_max_color_targets()instead, which returns the exact same value.
- GraphicsStateGuardian.get_pipe()¶
Returns the graphics pipe on which this GSG was created.
- GraphicsStateGuardian.get_prepared_objects()¶
- GraphicsStateGuardian.get_prepared_textures()¶
- GraphicsStateGuardian.get_runtime_color_scale()¶
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.
- GraphicsStateGuardian.get_scene()¶
- GraphicsStateGuardian.get_shader_generator()¶
Returns the
ShaderGeneratorobject that will be used by this GSG to generate shaders when necessary.
- GraphicsStateGuardian.get_shader_model()¶
Returns the
ShaderModel
- GraphicsStateGuardian.get_supports_2d_texture_array()¶
Returns true if this GSG can render 2-d textures array.
- GraphicsStateGuardian.get_supports_3d_texture()¶
Returns true if this GSG can render 3-d (volumetric) textures.
- GraphicsStateGuardian.get_supports_basic_shaders()¶
Returns true if this particular GSG supports arbfp1+arbvp1 or above.
- GraphicsStateGuardian.get_supports_buffer_texture()¶
Returns true if this GSG can render buffer textures.
- GraphicsStateGuardian.get_supports_cg_profile()¶
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_supports_compute_shaders()¶
Returns true if this particular GSG supports compute shaders.
- GraphicsStateGuardian.get_supports_cube_map()¶
Returns true if this GSG can render cube map textures.
- GraphicsStateGuardian.get_supports_cube_map_array()¶
Returns true if this GSG can render cube map arrays.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_supports_dual_source_blending()¶
Returns true if dual source (incoming1_color and incoming1_alpha) blend operands are supported by this GSG.
- GraphicsStateGuardian.get_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).
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_supports_geometry_shaders()¶
Returns true if this particular GSG supports geometry shaders.
- GraphicsStateGuardian.get_supports_glsl()¶
Returns true if this particular GSG supports GLSL shaders.
- GraphicsStateGuardian.get_supports_indirect_draw()¶
Returns true if this particular GSG supports draw calls for which the information comes from a buffer.
- GraphicsStateGuardian.get_supports_luminance_texture()¶
Returns true if this particular GSG supports luminance textures.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_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
SamplerStateobjects will result in reduced performance.
- GraphicsStateGuardian.get_supports_stencil()¶
Returns true if this particular GSG supports stencil buffers at all.
- GraphicsStateGuardian.get_supports_tessellation_shaders()¶
Returns true if this particular GSG supports tesselation shaders.
- GraphicsStateGuardian.get_supports_tex_non_pow2()¶
Returns true if this GSG can handle non power of two sized textures.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_supports_texture_dot3()¶
Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.
- GraphicsStateGuardian.get_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
TextureStageand re-use it for multiple inputs.
- GraphicsStateGuardian.get_supports_timer_query()¶
Returns true if this GSG supports a timer query.
- GraphicsStateGuardian.get_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.
- GraphicsStateGuardian.get_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().
- GraphicsStateGuardian.get_threading_model()¶
Returns the threading model that was used to create this GSG.
- GraphicsStateGuardian.get_timer_queries_active()¶
Returns true if timer queries are currently enabled on this GSG.
- GraphicsStateGuardian.has_extension()¶
- GraphicsStateGuardian.is_active()¶
Returns the active flag associated with the
GraphicsStateGuardian.
- GraphicsStateGuardian.is_hardware()¶
Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only.
- GraphicsStateGuardian.is_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.
- GraphicsStateGuardian.needs_reset()¶
Returns true if the gsg is marked as needing a reset.
- GraphicsStateGuardian.release_all()¶
Releases all prepared objects.
- GraphicsStateGuardian.release_all_geoms()¶
Frees the resources for all geoms associated with this GSG.
- GraphicsStateGuardian.release_all_index_buffers()¶
Frees the resources for all index buffers associated with this GSG.
- GraphicsStateGuardian.release_all_samplers()¶
Frees the resources for all samplers associated with this GSG.
- GraphicsStateGuardian.release_all_shader_buffers()¶
Frees the resources for all index buffers associated with this GSG.
- GraphicsStateGuardian.release_all_textures()¶
Frees the resources for all textures associated with this GSG.
- GraphicsStateGuardian.release_all_vertex_buffers()¶
Frees the resources for all vertex buffers associated with this GSG.
- GraphicsStateGuardian.restore_gamma()¶
- GraphicsStateGuardian.set_active()¶
Sets the active flag associated with the
GraphicsStateGuardian. If theGraphicsStateGuardianis marked inactive, nothing is rendered. This is not normally turned off unless there is a problem with the rendering detected at a low level.
- GraphicsStateGuardian.set_coordinate_system()¶
- GraphicsStateGuardian.set_flash_texture()¶
- GraphicsStateGuardian.set_gamma()¶
- GraphicsStateGuardian.set_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 givenDisplayRegiononly if it is true on both the GSG and on theDisplayRegion.
- GraphicsStateGuardian.set_loader()¶
Sets the Loader object that will be used by this GSG to load textures when necessary, if
get_incomplete_render()is true.
- GraphicsStateGuardian.set_scene()¶
- GraphicsStateGuardian.set_shader_generator()¶
Sets the
ShaderGeneratorobject that will be used by this GSG to generate shaders when necessary.
- GraphicsStateGuardian.set_shader_model()¶
Sets the
ShaderModel. This will override the auto- detected shader model during GSG reset. Useful for testing lower-end shaders.
- GraphicsStateGuardian.set_texture_quality_override()¶
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().
- static GraphicsStateGuardian.traverse_prepared_textures()¶
-
enum ShaderModel¶