Panda3D
Functions
graphicsStateGuardian.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "graphicsStateGuardian.h"
#include "graphicsEngine.h"
#include "config_display.h"
#include "textureContext.h"
#include "vertexBufferContext.h"
#include "indexBufferContext.h"
#include "renderBuffer.h"
#include "light.h"
#include "planeNode.h"
#include "throw_event.h"
#include "clockObject.h"
#include "pStatTimer.h"
#include "pStatGPUTimer.h"
#include "geomTristrips.h"
#include "geomTrifans.h"
#include "geomLinestrips.h"
#include "colorWriteAttrib.h"
#include "shader.h"
#include "pnotify.h"
#include "drawableRegion.h"
#include "displayRegion.h"
#include "graphicsOutput.h"
#include "texturePool.h"
#include "geomMunger.h"
#include "stateMunger.h"
#include "ambientLight.h"
#include "directionalLight.h"
#include "pointLight.h"
#include "sphereLight.h"
#include "spotlight.h"
#include "textureReloadRequest.h"
#include "shaderAttrib.h"
#include "materialAttrib.h"
#include "depthWriteAttrib.h"
#include "lightAttrib.h"
#include "texGenAttrib.h"
#include "shaderGenerator.h"
#include "lightLensNode.h"
#include "colorAttrib.h"
#include "colorScaleAttrib.h"
#include "clipPlaneAttrib.h"
#include "fogAttrib.h"
#include "config_pstatclient.h"
#include <limits.h>

Go to the source code of this file.

Functions

 CPT (TransformState) GraphicsStateGuardian
 Given a lens, this function calculates the appropriate projection matrix for this gsg. More...
 
 CPT (RenderState) GraphicsStateGuardian
 Called during draw to begin a three-step rendering phase to draw decals. More...
 
std::ostream & operator<< (std::ostream &out, GraphicsStateGuardian::ShaderModel sm)
 
 PT (OcclusionQueryContext) GraphicsStateGuardian
 Ends a previous call to begin_occlusion_query(). More...
 
 PT (TimerQueryContext) GraphicsStateGuardian
 Adds a timer query to the command stream, associated with the given PStats collector index. More...
 
 PT (GeomMunger) GraphicsStateGuardian
 Looks up or creates a GeomMunger object to munge vertices appropriate to this GSG for the indicated state. More...
 
 PT (Texture) GraphicsStateGuardian
 Like fetch_specified_value, but for texture inputs. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
1999-02-02
Author
fperazzi, PandaSE
Date
2010-05-05 _max_2d_texture_array_layers, _supports_2d_texture_array, get_supports_cg_profile)

Definition in file graphicsStateGuardian.cxx.

Function Documentation

◆ CPT() [1/2]

CPT ( TransformState  )

Given a lens, this function calculates the appropriate projection matrix for this gsg.

Returns what the cs_transform would be set to after a call to set_coordinate_system(cs).

The result depends on the peculiarities of the rendering API.

This is another way of saying the cs_transform when rendering the scene for a camera with the indicated coordinate system. Returns a transform that converts from the GSG's external coordinate system (as returned by get_coordinate_system()) to its internal coordinate system (as returned by get_internal_coordinate_system()). This is used for rendering. This is fundametically similar to do_issue_light(), with calls to apply_clip_plane() and enable_clip_planes(), as appropriate.

Definition at line 2020 of file graphicsStateGuardian.cxx.

References Lens::is_linear().

◆ CPT() [2/2]

CPT ( RenderState  )

Called during draw to begin a three-step rendering phase to draw decals.

The first step, begin_decal_base_first(), is called prior to drawing the base geometry. It should set up whatever internal state is appropriate, as well as returning a RenderState object that should be applied to the base geometry for rendering.

The second step, begin_decal_nested(), is called after drawing the base geometry and prior to drawing any of the nested decal geometry that is to be applied to the base geometry.

The third step, begin_decal_base_second(), is called after drawing the base geometry and the nested decal geometry, and prior to drawing the base geometry one more time (if needed).

It should return a RenderState object appropriate for rendering the base geometry the second time, or NULL if it is not necessary to re-render the base geometry.

Definition at line 2304 of file graphicsStateGuardian.cxx.

◆ PT() [1/4]

Ends a previous call to begin_occlusion_query().

This call returns the OcclusionQueryContext object that will (eventually) report the number of pixels that passed the depth test between the call to begin_occlusion_query() and end_occlusion_query().

Definition at line 723 of file graphicsStateGuardian.cxx.

◆ PT() [2/4]

Adds a timer query to the command stream, associated with the given PStats collector index.

Definition at line 735 of file graphicsStateGuardian.cxx.

◆ PT() [3/4]

PT ( GeomMunger  )

Looks up or creates a GeomMunger object to munge vertices appropriate to this GSG for the indicated state.

Creates a new GeomMunger object to munge vertices appropriate to this GSG for the indicated state.

Definition at line 753 of file graphicsStateGuardian.cxx.

References SimpleHashMap< Key, Value, Compare >::find(), SimpleHashMap< Key, Value, Compare >::get_data(), SimpleHashMap< Key, Value, Compare >::get_key(), SimpleHashMap< Key, Value, Compare >::get_num_entries(), SimpleHashMap< Key, Value, Compare >::is_empty(), and SimpleHashMap< Key, Value, Compare >::remove_element().

◆ PT() [4/4]

PT ( Texture  )

Like fetch_specified_value, but for texture inputs.

Returns a dummy shadow map that can be used for a light of the given type that does not cast shadows.

Returns a shadow map for the given light source.

If none exists, it is created, using the given host window to create the buffer, or the current window if that is set to NULL.

Creates a depth buffer for shadow mapping. A derived GSG can override this if it knows that a particular buffer type works best for shadow rendering.

Definition at line 1803 of file graphicsStateGuardian.cxx.

References LightAttrib::get_num_non_ambient_lights(), TextureAttrib::get_num_on_stages, LightAttrib::get_on_light, TextureAttrib::get_on_sampler, TextureAttrib::get_on_stage, TextureAttrib::get_on_texture, and TextureStage::get_tex_view_offset.