Uranium
Application Framework
Loading...
Searching...
No Matches
UM.View.RenderPass.RenderPass Class Reference

Base class for a rendering pass. More...

Inheritance diagram for UM.View.RenderPass.RenderPass:
UM.View.CompositePass.CompositePass UM.View.DefaultPass.DefaultPass UM.View.SelectionPass.SelectionPass

Public Member Functions

 __init__ (self, name, width, height, priority=0)
 
 getName (self)
 Get the name of this RenderPass.
 
 getSize (self)
 
 getPriority (self)
 Get the priority of this RenderPass.
 
 setSize (self, width, height)
 Set the size of this render pass.
 
 bind (self)
 Bind the render pass so it can be rendered to.
 
 release (self)
 Release the render pass.
 
 render (self)
 Render the contents of this render pass.
 
 getTextureId (self)
 Get the texture ID of this render pass so it can be reused by other passes.
 
 getOutput (self)
 Get the pixel data produced by this render pass.
 

Static Public Attributes

int MaximumPriority = 999
 The maximum priority of a render pass.
 

Protected Member Functions

 _updateRenderStorage (self)
 private:
 

Protected Attributes

 _name
 
 _width
 
 _height
 
 _priority
 
 _gl
 
 _fbo
 

Detailed Description

Base class for a rendering pass.

The RenderPass class encapsulates a render pass, that is a single step in the rendering process.

Note
While the render pass could technically support render to texture without using Framebuffer Objects, the PyQt bindings object lacks support for any function like glReadPixels. Therefore, the Qt OpenGL initialization code checks for FBO support and aborts the program if no support is found.

Member Function Documentation

◆ bind()

UM.View.RenderPass.RenderPass.bind (   self)

Bind the render pass so it can be rendered to.

This will make sure everything is set up so the contents of this render pass will be updated correctly. It should be called as part of your render() implementation.

Note
It is very important to call release() after a call to bind(), once done with rendering.

◆ getName()

UM.View.RenderPass.RenderPass.getName (   self)

Get the name of this RenderPass.

Returns
string The name of the render pass.

◆ getOutput()

UM.View.RenderPass.RenderPass.getOutput (   self)

Get the pixel data produced by this render pass.

This returns an object that contains the pixel data for this render pass.

Note
The current object type returned is currently dependant on the specific implementation of the UM.View.GL.FrameBufferObject class.

◆ getPriority()

UM.View.RenderPass.RenderPass.getPriority (   self)

Get the priority of this RenderPass.

The priority is used for ordering the render passes. Lower priority render passes are rendered earlier and are available for later render passes to use as texture sources.

Returns
int The priority of this render pass.

◆ getTextureId()

UM.View.RenderPass.RenderPass.getTextureId (   self)

Get the texture ID of this render pass so it can be reused by other passes.

Returns
int The OpenGL texture ID used by this pass.

◆ release()

UM.View.RenderPass.RenderPass.release (   self)

Release the render pass.

This makes sure the contents of this render pass are properly updated at the end of rendering.

◆ render()

UM.View.RenderPass.RenderPass.render (   self)

Render the contents of this render pass.

This method should be reimplemented by subclasses to perform the actual rendering of the render pass.

Reimplemented in UM.View.CompositePass.CompositePass, UM.View.DefaultPass.DefaultPass, and UM.View.SelectionPass.SelectionPass.

◆ setSize()

UM.View.RenderPass.RenderPass.setSize (   self,
  width,
  height 
)

Set the size of this render pass.

Parameters
widthint The new width of the render pass.
heightint The new height of the render pass.
Note
This will recreate the storage object used by the render pass. Due to that, the contents will be invalid after resizing until the render pass is rendered again.

Member Data Documentation

◆ MaximumPriority

int UM.View.RenderPass.RenderPass.MaximumPriority = 999
static

The maximum priority of a render pass.

Priority should always be less than this.


The documentation for this class was generated from the following file: