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

A rectangular subregion within a window for rendering into. More...

Inheritance diagram for DisplayRegion:
TypedReferenceCount DrawableRegion TypedObject ReferenceCount StereoDisplayRegion

Public Member Functions

 clearCullCallback ()
 Removes the callback set by an earlier call to set_cull_callback(). More...
 
 clearDrawCallback ()
 Removes the callback set by an earlier call to set_draw_callback(). More...
 
float getBottom (int i)
 Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. More...
 
NodePath getCamera (Thread current_thread)
 Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More...
 
CallbackObject getCullCallback ()
 Returns the CallbackObject set by set_cull_callback(). More...
 
CullTraverser getCullTraverser ()
 Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
LVecBase4 getDimensions (int i)
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More...
 
CallbackObject getDrawCallback ()
 Returns the CallbackObject set by set_draw_callback(). More...
 
bool getIncompleteRender ()
 Returns the incomplete_render flag. More...
 
float getLeft (int i)
 Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. More...
 
int getLensIndex ()
 Returns the specific lens of the associated Camera that will be used for rendering this scene. More...
 
int getNumRegions ()
 Returns the number of regions, see set_num_regions. More...
 
GraphicsPipe getPipe ()
 Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More...
 
int getPixelHeight (int i)
 Returns the height of the DisplayRegion in pixels. More...
 
LVecBase2i getPixelSize (int i)
 Returns the size of the DisplayRegion in pixels. More...
 
int getPixelWidth (int i)
 Returns the width of the DisplayRegion in pixels. More...
 
float getRight (int i)
 Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. More...
 
bool getScissorEnabled ()
 Returns whether or not scissor testing is enabled for this region. More...
 
Texture getScreenshot ()
 Captures the most-recently rendered image from the framebuffer and returns it as a Texture, or NULL on failure. More...
 
bool getScreenshot (PNMImage image)
 Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More...
 
int getSort ()
 Returns the sort value associated with the DisplayRegion. More...
 
Lens::StereoChannel getStereoChannel ()
 Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image. More...
 
int getTargetTexPage ()
 Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More...
 
int getTextureReloadPriority ()
 Returns the priority which is assigned to asynchronous texture reload requests. More...
 
int getTexViewOffset ()
 Returns the current texture view offset for this DisplayRegion. More...
 
float getTop (int i)
 Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. More...
 
GraphicsOutput getWindow ()
 Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More...
 
bool isActive ()
 Returns the active flag associated with the DisplayRegion. More...
 
bool isStereo ()
 Returns true if this is a StereoDisplayRegion, false otherwise. More...
 
PandaNode makeCullResultGraph ()
 Returns a special scene graph constructed to represent the results of the last frame's cull operation. More...
 
 output (Ostream out)
 
bool saveScreenshot (const Filename filename, str image_comment)
 Saves a screenshot of the region to the indicated filename. More...
 
Filename saveScreenshotDefault (str prefix)
 Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More...
 
 setActive (bool active)
 Sets the active flag associated with the DisplayRegion. More...
 
 setCamera (const NodePath camera)
 Sets the camera that is associated with this DisplayRegion. More...
 
 setCubeMapIndex (int cube_map_index)
 Deprecated; replaced by set_target_tex_page(). More...
 
 setCullCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. More...
 
 setCullTraverser (CullTraverser trav)
 Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
 setDimensions (const LVecBase4 dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
 setDimensions (float l, float r, float b, float t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
 setDimensions (int i, const LVecBase4 dimensions)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
 setDimensions (int i, float l, float r, float b, float t)
 Changes the portion of the framebuffer this DisplayRegion corresponds to. More...
 
 setDrawCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. More...
 
 setIncompleteRender (bool incomplete_render)
 Sets the incomplete_render flag. More...
 
 setLensIndex (int index)
 Sets the lens index, allows for multiple lenses to be attached to a camera. More...
 
 setNumRegions (int i)
 Sets the number of regions that this DisplayRegion indicates. More...
 
 setScissorEnabled (bool scissor_enabled)
 Sets whether or not scissor testing is enabled for this region. More...
 
 setSort (int sort)
 Sets the sort value associated with the DisplayRegion. More...
 
 setStereoChannel (Lens::StereoChannel stereo_channel)
 Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. More...
 
 setTargetTexPage (int page)
 This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture. More...
 
 setTextureReloadPriority (int texture_reload_priority)
 Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. More...
 
 setTexViewOffset (int tex_view_offset)
 Sets the current texture view offset for this DisplayRegion. 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...
 
- Public Member Functions inherited from DrawableRegion
 disableClears ()
 Disables both the color and depth clear. More...
 
bool getClearActive (int n)
 Gets the clear-active flag for any bitplane. More...
 
const LColor getClearColor ()
 Returns the current clear color value. More...
 
bool getClearColorActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
float getClearDepth ()
 Returns the current clear depth value. More...
 
bool getClearDepthActive ()
 Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More...
 
unsigned int getClearStencil ()
 Returns the current clear stencil value. More...
 
bool getClearStencilActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
const LColor getClearValue (int n)
 Returns the clear value for any bitplane. More...
 
float getPixelFactor ()
 Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More...
 
float getPixelZoom ()
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More...
 
bool isAnyClearActive ()
 Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear. More...
 
 setClearActive (int n, bool clear_aux_active)
 Sets the clear-active flag for any bitplane. More...
 
 setClearColor (const LColor color)
 Sets the clear color to the indicated value. More...
 
 setClearColorActive (bool clear_color_active)
 Toggles the flag that indicates whether the color buffer should be cleared every frame. More...
 
 setClearDepth (float depth)
 Sets the clear depth to the indicated value. More...
 
 setClearDepthActive (bool clear_depth_active)
 Toggles the flag that indicates whether the depth buffer should be cleared every frame. More...
 
 setClearStencil (unsigned int stencil)
 
 setClearStencilActive (bool clear_stencil_active)
 Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More...
 
 setClearValue (int n, const LColor clear_value)
 Sets the clear value for any bitplane. More...
 
 setPixelZoom (float pixel_zoom)
 Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More...
 
bool supportsPixelZoom ()
 Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
static Filename makeScreenshotFilename (str prefix)
 Synthesizes a suitable default filename for passing to save_screenshot(). More...
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from DrawableRegion
static int getRenderbufferType (int plane)
 Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More...
 

Public Attributes

bool active
 Returns the active flag associated with the DisplayRegion. More...
 
NodePath camera
 Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More...
 
CallbackObject cull_callback
 Returns the CallbackObject set by set_cull_callback(). More...
 
CullTraverser cull_traverser
 Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More...
 
LVecBase4 dimensions
 Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More...
 
CallbackObject draw_callback
 Returns the CallbackObject set by set_draw_callback(). More...
 
bool incomplete_render
 Returns the incomplete_render flag. More...
 
int lens_index
 Returns the specific lens of the associated Camera that will be used for rendering this scene. More...
 
GraphicsPipe pipe
 Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More...
 
LVecBase2i pixel_size
 Returns the size of the DisplayRegion in pixels. More...
 
bool scissor_enabled
 Returns whether or not scissor testing is enabled for this region. More...
 
int sort
 Returns the sort value associated with the DisplayRegion. More...
 
bool stereo
 Returns true if this is a StereoDisplayRegion, false otherwise. More...
 
Lens::StereoChannel stereo_channel
 Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image. More...
 
int target_tex_page
 Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More...
 
int tex_view_offset
 Returns the current texture view offset for this DisplayRegion. More...
 
int texture_reload_priority
 Returns the priority which is assigned to asynchronous texture reload requests. More...
 
GraphicsOutput window
 Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. 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...
 
- Public Attributes inherited from DrawableRegion
const LColor clear_color
 Returns the current clear color value. More...
 
float clear_depth
 Returns the current clear depth value. More...
 
unsigned int clear_stencil
 Returns the current clear stencil value. More...
 
float pixel_factor
 Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More...
 
float pixel_zoom
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More...
 

Additional Inherited Members

- Public Types inherited from DrawableRegion
enum  RenderTexturePlane {
  RTP_stencil = 0, RTP_depth_stencil = 1, RTP_color = 2, RTP_aux_rgba_0 = 3,
  RTP_aux_rgba_1 = 4, RTP_aux_rgba_2 = 5, RTP_aux_rgba_3 = 6, RTP_aux_hrgba_0 = 7,
  RTP_aux_hrgba_1 = 8, RTP_aux_hrgba_2 = 9, RTP_aux_hrgba_3 = 10, RTP_aux_float_0 = 11,
  RTP_aux_float_1 = 12, RTP_aux_float_2 = 13, RTP_aux_float_3 = 14, RTP_depth = 15,
  RTP_COUNT = 16
}
 

Detailed Description

A rectangular subregion within a window for rendering into.

Typically, there is one DisplayRegion that covers the whole window, but you may also create smaller DisplayRegions for having different regions within the window that represent different scenes. You may also stack up DisplayRegions like panes of glass, usually for layering 2-d interfaces on top of a 3-d scene.

Member Function Documentation

◆ clearCullCallback()

clearCullCallback ( )

Removes the callback set by an earlier call to set_cull_callback().

◆ clearDrawCallback()

clearDrawCallback ( )

Removes the callback set by an earlier call to set_draw_callback().

◆ getBottom()

float getBottom ( int  i)

Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput.

This number will be in the range [0..1].

◆ getCamera()

NodePath getCamera ( Thread  current_thread)

Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getCullCallback()

CallbackObject getCullCallback ( )

Returns the CallbackObject set by set_cull_callback().

◆ getCullTraverser()

CullTraverser getCullTraverser ( )

Returns the CullTraverser that will be used to draw the contents of this DisplayRegion.

◆ getDimensions()

LVecBase4 getDimensions ( int  i)

Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput.

These numbers will be in the range [0..1].

◆ getDrawCallback()

CallbackObject getDrawCallback ( )

Returns the CallbackObject set by set_draw_callback().

◆ getIncompleteRender()

bool getIncompleteRender ( )

Returns the incomplete_render flag.

See set_incomplete_render().

◆ getLeft()

float getLeft ( int  i)

Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.

This number will be in the range [0..1].

◆ getLensIndex()

int getLensIndex ( )

Returns the specific lens of the associated Camera that will be used for rendering this scene.

Most Cameras hold only one lens, but for multiple lenses this method may be used to selected between them.

◆ getNumRegions()

int getNumRegions ( )

Returns the number of regions, see set_num_regions.

◆ getPipe()

GraphicsPipe getPipe ( )

Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated.

◆ getPixelHeight()

int getPixelHeight ( int  i)

Returns the height of the DisplayRegion in pixels.

◆ getPixelSize()

LVecBase2i getPixelSize ( int  i)

Returns the size of the DisplayRegion in pixels.

◆ getPixelWidth()

int getPixelWidth ( int  i)

Returns the width of the DisplayRegion in pixels.

◆ getRight()

float getRight ( int  i)

Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput.

This number will be in the range [0..1].

◆ getScissorEnabled()

bool getScissorEnabled ( )

Returns whether or not scissor testing is enabled for this region.

The default is true, except for the overlay display region.

◆ getScreenshot() [1/2]

Texture getScreenshot ( )

Captures the most-recently rendered image from the framebuffer and returns it as a Texture, or NULL on failure.

◆ getScreenshot() [2/2]

bool getScreenshot ( PNMImage  image)

Captures the most-recently rendered image from the framebuffer into the indicated PNMImage.

Returns true on success, false on failure.

◆ getSort()

int getSort ( )

Returns the sort value associated with the DisplayRegion.

◆ getStereoChannel()

Lens::StereoChannel getStereoChannel ( )

Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image.

See set_stereo_channel().

◆ getTargetTexPage()

int getTargetTexPage ( )

Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page.

See set_target_tex_page().

◆ getTextureReloadPriority()

int getTextureReloadPriority ( )

Returns the priority which is assigned to asynchronous texture reload requests.

See set_texture_reload_priority().

◆ getTexViewOffset()

int getTexViewOffset ( )

Returns the current texture view offset for this DisplayRegion.

This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion.

For a StereoDisplayRegion, this is normally 0 for the left eye, and 1 for the right eye, to support stereo textures.

◆ getTop()

float getTop ( int  i)

Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput.

This number will be in the range [0..1].

◆ getWindow()

GraphicsOutput getWindow ( )

Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated.

◆ isActive()

bool isActive ( )

Returns the active flag associated with the DisplayRegion.

◆ isStereo()

bool isStereo ( )

Returns true if this is a StereoDisplayRegion, false otherwise.

◆ makeCullResultGraph()

PandaNode makeCullResultGraph ( )

Returns a special scene graph constructed to represent the results of the last frame's cull operation.

This will be a hierarchy of nodes, one node for each bin, each of which will in term be a parent of a number of GeomNodes, representing the geometry drawn in each bin.

This is useful mainly for high-level debugging and abstraction tools; it should not be mistaken for the low-level cull result itself, which is constructed and maintained internally. No such scene graph is normally constructed during the rendering of a frame; this is an artificial construct created for the purpose of making it easy to analyze the results of the cull operation.

◆ makeScreenshotFilename()

static Filename makeScreenshotFilename ( str  prefix)
static

Synthesizes a suitable default filename for passing to save_screenshot().

The default filename is generated from the supplied prefix and from the Config variable screenshot-filename, which contains the following strings:

%~p - the supplied prefix %~f - the frame count %~e - the value of screenshot-extension All other % strings in strftime().

◆ output()

output ( Ostream  out)

◆ saveScreenshot()

bool saveScreenshot ( const Filename  filename,
str  image_comment 
)

Saves a screenshot of the region to the indicated filename.

Returns true on success, false on failure.

◆ saveScreenshotDefault()

Filename saveScreenshotDefault ( str  prefix)

Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.

The filename is generated by make_screenshot_filename().

◆ setActive()

setActive ( bool  active)

Sets the active flag associated with the DisplayRegion.

If the DisplayRegion is marked inactive, nothing is rendered.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setCamera()

setCamera ( const NodePath  camera)

Sets the camera that is associated with this DisplayRegion.

There is a one-to-many association between cameras and DisplayRegions; one camera may be shared by multiple DisplayRegions.

The camera is actually set via a NodePath, which clarifies which instance of the camera (if there happen to be multiple instances) we should use.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setCubeMapIndex()

setCubeMapIndex ( int  cube_map_index)

Deprecated; replaced by set_target_tex_page().

◆ setCullCallback()

setCullCallback ( CallbackObject  object)

Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal.

This callback will be made during the cull thread.

The cull traversal is responsible for determining which nodes are visible and within the view frustum, and for accumulating state and transform, and generally building up the list of CullableObjects that are to be eventually passed to the draw traversal for rendering.

At the time the cull traversal callback is made, the traversal for this DisplayRegion has not yet started.

The callback is passed an instance of a DisplayRegionCullCallbackData, which contains pointers to the current scene information, as well as the current DisplayRegion and GSG. The callback replaces the normal cull behavior, so if your callback does nothing, the scene graph will not be traversed and therefore nothing will be drawn. If you wish the normal cull traversal to be performed for this DisplayRegion, you must call cbdata->upcall() from your callback.

◆ setCullTraverser()

setCullTraverser ( CullTraverser  trav)

Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion.

Normally the default CullTraverser is sufficient, but this may be changed to change the default cull behavior.

◆ setDimensions() [1/4]

setDimensions ( const LVecBase4  dimensions)

Changes the portion of the framebuffer this DisplayRegion corresponds to.

The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen.

◆ setDimensions() [2/4]

setDimensions ( float  l,
float  r,
float  b,
float  t 
)

Changes the portion of the framebuffer this DisplayRegion corresponds to.

The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen.

◆ setDimensions() [3/4]

setDimensions ( int  i,
const LVecBase4  dimensions 
)

Changes the portion of the framebuffer this DisplayRegion corresponds to.

The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setDimensions() [4/4]

setDimensions ( int  i,
float  l,
float  r,
float  b,
float  t 
)

Changes the portion of the framebuffer this DisplayRegion corresponds to.

The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen.

◆ setDrawCallback()

setDrawCallback ( CallbackObject  object)

Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal.

This callback will be made during the draw thread.

The draw traversal is responsible for actually issuing the commands to the graphics engine to draw primitives. Its job is to walk through the list of CullableObjects build up by the cull traversal, as quickly as possible, issuing the appropriate commands to draw each one.

At the time the draw traversal callback is made, the graphics state is in the initial state, and no projection matrix or modelview matrix is in effect. begin_scene() has not yet been called, and no objects have yet been drawn. However, the viewport has already been set to the appropriate part of the window, and the clear commands for this DisplayRegion (if any) have been issued.

The callback is passed an instance of a DisplayRegionDrawCallbackData, which contains pointers to the current scene information, as well as the current DisplayRegion and GSG. The callback replaces the normal draw behavior, so if your callback does nothing, nothing in the DisplayRegion will be drawn. If you wish the draw traversal to continue to draw the contents of this DisplayRegion, you must call cbdata->upcall() from your callback.

◆ 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.

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

See GraphicsStateGuardian::set_incomplete_render() for more detail.

◆ setLensIndex()

setLensIndex ( int  index)

Sets the lens index, allows for multiple lenses to be attached to a camera.

This is useful for a variety of setups, such as fish eye rendering. The default is 0.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setNumRegions()

setNumRegions ( int  i)

Sets the number of regions that this DisplayRegion indicates.

Usually, this number is 1 (and it is always at least 1), and only the first is used for rendering. However, if more than one is provided, you may select which one to render into using a geometry shader (gl_ViewportIndex in GLSL).

◆ setScissorEnabled()

setScissorEnabled ( bool  scissor_enabled)

Sets whether or not scissor testing is enabled for this region.

The default is true, except for the overlay display region.

◆ setSort()

setSort ( int  sort)

Sets the sort value associated with the DisplayRegion.

Within a window, DisplayRegions will be rendered in order from the lowest sort value to the highest.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setStereoChannel()

setStereoChannel ( Lens::StereoChannel  stereo_channel)

Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image.

This automatically adjusts the lens that is used to render to this DisplayRegion to its left or right eye, according to the lens's stereo properties.

When the DisplayRegion is attached to a stereo window (one for which is_stereo() returns true), this also specifies which physical channel the DisplayRegion renders to.

Normally you would create at least two DisplayRegions for a stereo window, one for each of the left and right channels. The two DisplayRegions may share the same camera (and thus the same lens); this parameter is used to control the exact properties of the lens when it is used to render into this DisplayRegion.

Also see the StereoDisplayRegion, which automates managing a pair of left/right DisplayRegions.

An ordinary DisplayRegion may be set to SC_mono, SC_left, or SC_right. You may set SC_stereo only on a StereoDisplayRegion.

This call also resets tex_view_offset to its default value, which is 0 for the left eye or 1 for the right eye of a stereo display region, or 0 for a mono display region.

◆ setTargetTexPage()

setTargetTexPage ( int  page)

This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture.

This sets up the DisplayRegion to render to the ith page and jth view of its associated texture(s); the value must be consistent with the range of values availble to the texture. A normal DisplayRegion that is not associated with any particular page should be set to page -1 and view 0.

This is particularly useful when rendering cube maps and/or stereo textures.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

◆ setTextureReloadPriority()

setTextureReloadPriority ( int  texture_reload_priority)

Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion.

This controls which textures are loaded first when multiple textures need to be reloaded at once; it also controls the relative priority between asynchronous texture loads and asynchronous model or animation loads.

Specifying a larger number here makes the textures rendered by this DisplayRegion load up first. This may be particularly useful to do, for instance, for the DisplayRegion that renders the gui.

◆ setTexViewOffset()

setTexViewOffset ( int  tex_view_offset)

Sets the current texture view offset for this DisplayRegion.

This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion.

For a StereoDisplayRegion, this is normally 0 for the left eye, and 1 for the right eye, to support stereo textures. This is set automatically when you call set_stereo_channel().

Member Data Documentation

◆ active

bool active

Returns the active flag associated with the DisplayRegion.

◆ camera

NodePath camera

Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated.

◆ cull_callback

CallbackObject cull_callback

Returns the CallbackObject set by set_cull_callback().

◆ cull_traverser

CullTraverser cull_traverser

Returns the CullTraverser that will be used to draw the contents of this DisplayRegion.

◆ dimensions

LVecBase4 dimensions

Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput.

These numbers will be in the range [0..1].Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. These numbers will be in the range [0..1].Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. These numbers will be in the range [0..1].

◆ draw_callback

CallbackObject draw_callback

Returns the CallbackObject set by set_draw_callback().

◆ incomplete_render

bool incomplete_render

Returns the incomplete_render flag.

See set_incomplete_render().

◆ lens_index

int lens_index

Returns the specific lens of the associated Camera that will be used for rendering this scene.

Most Cameras hold only one lens, but for multiple lenses this method may be used to selected between them.

◆ pipe

Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated.

◆ pixel_size

LVecBase2i pixel_size

Returns the size of the DisplayRegion in pixels.

◆ scissor_enabled

bool scissor_enabled

Returns whether or not scissor testing is enabled for this region.

The default is true, except for the overlay display region.

◆ sort

int sort

Returns the sort value associated with the DisplayRegion.

◆ stereo

bool stereo

Returns true if this is a StereoDisplayRegion, false otherwise.

◆ stereo_channel

Lens::StereoChannel stereo_channel

Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image.

See set_stereo_channel().

◆ target_tex_page

int target_tex_page

Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page.

See set_target_tex_page().

◆ tex_view_offset

int tex_view_offset

Returns the current texture view offset for this DisplayRegion.

This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion.

For a StereoDisplayRegion, this is normally 0 for the left eye, and 1 for the right eye, to support stereo textures.

◆ texture_reload_priority

int texture_reload_priority

Returns the priority which is assigned to asynchronous texture reload requests.

See set_texture_reload_priority().

◆ window

Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated.