Uranium
Application Framework
|
The RenderBatch class represent a batch of objects that should be rendered. More...
Classes | |
class | BlendMode |
Blending mode. More... | |
class | RenderMode |
The mode to render objects in. More... | |
class | RenderType |
The type of render batch. More... | |
Public Member Functions | |
def | __init__ (self, shader, **kwargs) |
Init method. More... | |
def | renderType (self) |
The RenderType for this batch. More... | |
def | renderMode (self) |
The RenderMode for this batch. More... | |
def | shader (self) |
The shader for this batch. More... | |
def | backfaceCull (self) |
Whether backface culling is enabled or not. More... | |
def | renderRange (self) |
The range of elements to render. More... | |
def | items (self) |
The items to render. More... | |
def | __lt__ (self, other) |
Less-than comparison method. More... | |
def | addItem (self, transformation, mesh, uniforms=None) |
Add an item to render to this batch. More... | |
def | render (self, camera) |
Render the batch. More... | |
The RenderBatch class represent a batch of objects that should be rendered.
Each RenderBatch contains a list of objects to render and all state related to those objects. It tries to minimize changes to state between render the individual objects. This means that for example the ShaderProgram used is only bound once, at the start of rendering. There are a few values, like the model-view-projection matrix that are updated for each object.
Currently RenderBatch objects are created each frame including the VertexArrayObject (VAO). This is done to greatly simplify managing RenderBatch-changes. Whenever (sets of) RenderBatches are managed throughout the lifetime of a session, crossing multiple frames, the usage of VAO's can improve performance by reusing them.
def UM.View.RenderBatch.RenderBatch.__init__ | ( | self, | |
shader, | |||
** | kwargs | ||
) |
Init method.
shader | The shader to use for this batch. |
kwargs | Keyword arguments. Possible values:
|
def UM.View.RenderBatch.RenderBatch.__lt__ | ( | self, | |
other | |||
) |
Less-than comparison method.
This sorts RenderType.Solid before RenderType.Transparent and RenderType.Transparent before RenderType.Overlay.
def UM.View.RenderBatch.RenderBatch.addItem | ( | self, | |
transformation, | |||
mesh, | |||
uniforms = None |
|||
) |
Add an item to render to this batch.
transformation | The transformation matrix to use for rendering the item. |
mesh | The mesh to render with the transform matrix. |
uniforms | A dict of additional uniform bindings to set when rendering the item. Note these are set specifically for this item. |
def UM.View.RenderBatch.RenderBatch.backfaceCull | ( | self | ) |
Whether backface culling is enabled or not.
def UM.View.RenderBatch.RenderBatch.items | ( | self | ) |
The items to render.
def UM.View.RenderBatch.RenderBatch.render | ( | self, | |
camera | |||
) |
Render the batch.
camera | The camera to render from. |
def UM.View.RenderBatch.RenderBatch.renderMode | ( | self | ) |
The RenderMode for this batch.
def UM.View.RenderBatch.RenderBatch.renderRange | ( | self | ) |
The range of elements to render.
def UM.View.RenderBatch.RenderBatch.renderType | ( | self | ) |
The RenderType for this batch.
def UM.View.RenderBatch.RenderBatch.shader | ( | self | ) |
The shader for this batch.