OpenGL implementation of the Renderer interface. More...
#include <mitsuba/hw/glrenderer.h>
Inheritance diagram for mitsuba::GLRenderer:Public Member Functions | |
| GLRenderer (Session *session) | |
| Construct a new OpenGL rendering interface. More... | |
| virtual void | init (Device *device, Renderer *other=NULL) |
| Initialize the renderer. More... | |
| void | reconfigure (const Device *device) |
| Reconfigure the renderer for a certain device (e.g. after a resize event) More... | |
| virtual void | shutdown () |
| Shut the renderer down. More... | |
| GPUTexture * | createGPUTexture (const std::string &name, Bitmap *bitmap=NULL) |
| Create a new GPU texture object. More... | |
| GPUGeometry * | createGPUGeometry (const Shape *shape) |
| Create a new GPU geometry object. More... | |
| GPUProgram * | createGPUProgram (const std::string &name) |
| Create a new GPU program object. More... | |
| GPUSync * | createGPUSync () |
| Create a new synchronization object. More... | |
| void | clear () |
| Clear the viewport. More... | |
| void | setCamera (const ProjectiveCamera *pCamera, const Point2 &apertureSample=Point2(0.5f), const Point2 &aaSample=Point2(0.5f), Float timeSample=0.5f) |
| Configure the camera. More... | |
| void | setCamera (const Matrix4x4 &proj, const Matrix4x4 &view) |
| Configure the camera (manual) More... | |
| void | setMatrix (EMatrixType type, const Matrix4x4 &value) |
| Directly set the modelview or projection matrix. More... | |
| Matrix4x4 | getMatrix (EMatrixType type) const |
| Fetch the currently set modelview or projection matrix. More... | |
| void | beginDrawingMeshes (bool transmitOnlyPositions=false) |
| Set up the renderer for drawing triangle geometry. More... | |
| void | drawMesh (const TriMesh *geo) |
| Send a triangle mesh to the renderer. More... | |
| void | drawMesh (const GPUGeometry *geo) |
| Send a triangle mesh to the renderer. More... | |
| void | endDrawingMeshes () |
| Clean up the renderer after drawing triangle geometry. More... | |
| void | drawAll (const std::vector< TransformedGPUGeometry > &allGeometry) |
| Quickly draw all geometry that has been registered with the renderer. More... | |
| void | blitTexture (const GPUTexture *texture, bool flipVertically=false, bool centerHoriz=true, bool centerVert=true, const Vector2i &offset=Vector2i(0, 0)) |
| Draw a quad using the given texture. More... | |
| void | blitQuad (bool flipVertically) |
| Blit a screen-sized quad. More... | |
| void | drawText (const Point2i &pos, const Font *font, const std::string &text) |
| void | setPointSize (Float size) |
| Set the size of point primitives. More... | |
| void | drawPoint (const Point &p) |
| Draw a point. More... | |
| void | drawLine (const Point &a, const Point &b) |
| Draw a line between two specified points. More... | |
| void | drawPoint (const Point2 &p) |
| Draw a point (2D) More... | |
| void | drawPoint (const Point2i &p) |
| Draw a point (2D, integer coordinates) More... | |
| void | drawLine (const Point2 &a, const Point2 &b) |
| Draw a line between two specified points (2D) More... | |
| void | drawLine (const Point2i &a, const Point2i &b) |
| Draw a line between two specified points (2D, integer coordinates) More... | |
| void | drawRectangle (const Point2 &a, const Point2 &b) |
| Draw a rectangle between two specified points (2D) More... | |
| void | drawRectangle (const Point2i &a, const Point2i &b) |
| Draw a rectangle between two specified points (2D, integer coordinates) More... | |
| void | drawFilledRectangle (const Point2 &a, const Point2 &b) |
| Draw a filled rectangle between two specified points (2D) More... | |
| void | drawFilledRectangle (const Point2i &a, const Point2i &b) |
| Draw a filled rectangle between two specified points (2D, integer coordinates) More... | |
| void | drawEllipse (const Point ¢er, const Vector &axis1, const Vector &axis2) |
| Draw an ellipse with the specified center and axes. More... | |
| void | drawAABB (const AABB &aabb) |
| Draw a wire-frame axis-aligned box. More... | |
| void | setBlendMode (EBlendMode mode) |
| Set the currently active blending mode. More... | |
| void | setCullMode (ECullMode mode) |
| Set the currently active culling mode. More... | |
| void | setDepthMask (bool value) |
| Activate or deactivate the writing of depth information. More... | |
| void | setDepthTest (bool value) |
| Activate or deactivate depth testing. More... | |
| void | setColor (const Color3 &color, Float alpha=1.0f) |
| Set the current fixed-function pipeline color. More... | |
| void | setColor (const Spectrum &spec, Float alpha=1.0f) |
| Set the current fixed-function pipeline color. More... | |
| void | setClearDepth (Float depth) |
| Set the depth value that is written by clear() More... | |
| void | setClearColor (const Color3 &color) |
| Set the color value that is written by clear() More... | |
| void | clearTransforms () |
| Clear the view and projection transformations. More... | |
| void | flush () |
| Flush outstanding rendering commands. More... | |
| void | finish () |
| Completely finish outstanding rendering commands. More... | |
| void | checkError (bool onlyWarn=true) |
| Check for any error indications. More... | |
| void | debugString (const std::string &text) |
| Send a debug string to the rendering backend. More... | |
| virtual const Class * | getClass () const |
| Retrieve this object's class. More... | |
Public Member Functions inherited from mitsuba::Renderer | |
| const RendererCapabilities * | getCapabilities () const |
| Return the renderer's capabilities. More... | |
| Shader * | registerShaderForResource (const HWResource *res) |
| Shader * | getShaderForResource (const HWResource *res) |
| Look up a shader by the associated HWResource object. More... | |
| void | unregisterShaderForResource (const HWResource *res) |
| Decrease the reference count of a shader. Deletes it when zero is reached. More... | |
| GPUGeometry * | registerGeometry (const Shape *shape) |
| bool | unregisterGeometry (const Shape *shape) |
| Unregister a triangle mesh from the renderer. More... | |
| void | setLogLevel (ELogLevel logLevel) |
| Set the log level. More... | |
| void | setWarnLogLevel (ELogLevel logLevel) |
| Set the log level for warnings. More... | |
Public Member Functions inherited from Object | |
| Object () | |
| Construct a new object. More... | |
| int | getRefCount () const |
| Return the current reference count. More... | |
| void | incRef () const |
| Increase the reference count of the object by one. More... | |
| void | decRef (bool autoDeallocate=true) const |
| Decrease the reference count of the object and possibly deallocate it. More... | |
| virtual std::string | toString () const |
| Return a human-readable string representation of the object's contents. More... | |
Static Public Attributes | |
| static Class * | m_theClass |
Static Public Attributes inherited from mitsuba::Renderer | |
| static Class * | m_theClass |
Static Public Attributes inherited from Object | |
| static Class * | m_theClass |
| Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
| virtual | ~GLRenderer () |
| Virtual destructor. More... | |
Protected Member Functions inherited from mitsuba::Renderer | |
| Renderer (Session *session) | |
| Construct a new OpenI rendering interface. More... | |
| virtual | ~Renderer () |
| Virtual destructor. More... | |
Protected Member Functions inherited from Object | |
| virtual | ~Object () |
| Virtual private deconstructor. (Will only be called by ref) More... | |
Protected Attributes | |
| bool | m_transmitOnlyPositions |
| bool | m_normalsEnabled |
| bool | m_texcoordsEnabled |
| bool | m_tangentsEnabled |
| bool | m_colorsEnabled |
| size_t | m_queuedTriangles |
| int | m_stride |
Protected Attributes inherited from mitsuba::Renderer | |
| ref< Session > | m_session |
| ref< Device > | m_device |
| ref< RendererCapabilities > | m_capabilities |
| std::map< const HWResource *, ShaderRecord > | m_shaders |
| std::map< const Shape *, GPUGeometry * > | m_geometry |
| bool | m_initialized |
| bool | m_borrowed |
| std::string | m_driverVendor |
| std::string | m_driverRenderer |
| std::string | m_driverVersion |
| ELogLevel | m_logLevel |
| ELogLevel | m_warnLogLevel |
Additional Inherited Members | |
Public Types inherited from mitsuba::Renderer | |
| enum | EBlendMode { EBlendNone = 0, EBlendAlpha, EBlendAdditive } |
| enum | ECullMode { ECullNone = 0, ECullFront, ECullBack } |
| Possible culling modes. More... | |
| enum | EMatrixType { EProjection = 0, EModelView } |
| Matrices of the fixed function pipeline. More... | |
| typedef std::pair< const GPUGeometry *, Matrix4x4 > | TransformedGPUGeometry |
Static Public Member Functions inherited from mitsuba::Renderer | |
| static Renderer * | create (Session *session) |
Static Public Member Functions inherited from Object | |
| static void | staticInitialization () |
| Initializes the built-in reference count debugger (if enabled) More... | |
| static void | staticShutdown () |
| Free the memory taken by staticInitialization() More... | |
OpenGL implementation of the Renderer interface.
| mitsuba::GLRenderer::GLRenderer | ( | Session * | session | ) |
Construct a new OpenGL rendering interface.
|
protectedvirtual |
Virtual destructor.
|
virtual |
Set up the renderer for drawing triangle geometry.
Implements mitsuba::Renderer.
|
virtual |
Blit a screen-sized quad.
Implements mitsuba::Renderer.
|
virtual |
Draw a quad using the given texture.
Implements mitsuba::Renderer.
|
virtual |
Check for any error indications.
Implements mitsuba::Renderer.
|
virtual |
Clear the viewport.
Implements mitsuba::Renderer.
|
virtual |
Clear the view and projection transformations.
Implements mitsuba::Renderer.
|
virtual |
Create a new GPU geometry object.
Implements mitsuba::Renderer.
|
virtual |
Create a new GPU program object.
Implements mitsuba::Renderer.
|
virtual |
Create a new synchronization object.
Implements mitsuba::Renderer.
|
virtual |
Create a new GPU texture object.
Implements mitsuba::Renderer.
|
virtual |
Send a debug string to the rendering backend.
This is mainly useful when an OpenGL trace is captured by a tool such as 'apitrace'.
Implements mitsuba::Renderer.
|
virtual |
Draw a wire-frame axis-aligned box.
Implements mitsuba::Renderer.
|
virtual |
Quickly draw all geometry that has been registered with the renderer.
Only transmits positions, hence this is mainly useful for shadow mapping.
Implements mitsuba::Renderer.
|
virtual |
Draw an ellipse with the specified center and axes.
Implements mitsuba::Renderer.
Draw a filled rectangle between two specified points (2D)
Implements mitsuba::Renderer.
Draw a filled rectangle between two specified points (2D, integer coordinates)
Implements mitsuba::Renderer.
Draw a line between two specified points.
Implements mitsuba::Renderer.
Draw a line between two specified points (2D)
Implements mitsuba::Renderer.
Draw a line between two specified points (2D, integer coordinates)
Implements mitsuba::Renderer.
|
virtual |
Send a triangle mesh to the renderer.
Implements mitsuba::Renderer.
|
virtual |
Send a triangle mesh to the renderer.
Implements mitsuba::Renderer.
|
virtual |
Draw a point.
Implements mitsuba::Renderer.
|
virtual |
Draw a point (2D)
Implements mitsuba::Renderer.
|
virtual |
Draw a point (2D, integer coordinates)
Implements mitsuba::Renderer.
Draw a rectangle between two specified points (2D)
Implements mitsuba::Renderer.
Draw a rectangle between two specified points (2D, integer coordinates)
Implements mitsuba::Renderer.
|
virtual |
Draw a line of text on the screen. The coordinates are specified in pixel coordinates, where the upper left corner is the origin
Implements mitsuba::Renderer.
|
virtual |
Clean up the renderer after drawing triangle geometry.
Implements mitsuba::Renderer.
|
virtual |
Completely finish outstanding rendering commands.
Implements mitsuba::Renderer.
|
virtual |
Flush outstanding rendering commands.
Implements mitsuba::Renderer.
|
virtual |
Retrieve this object's class.
Reimplemented from mitsuba::Renderer.
Reimplemented in mitsuba::NSGLRenderer, mitsuba::WGLRenderer, and mitsuba::GLXRenderer.
|
virtual |
Fetch the currently set modelview or projection matrix.
Implements mitsuba::Renderer.
Initialize the renderer.
Reimplemented from mitsuba::Renderer.
Reimplemented in mitsuba::NSGLRenderer, mitsuba::WGLRenderer, and mitsuba::GLXRenderer.
|
virtual |
Reconfigure the renderer for a certain device (e.g. after a resize event)
Implements mitsuba::Renderer.
|
virtual |
Set the currently active blending mode.
Implements mitsuba::Renderer.
|
virtual |
Configure the camera.
Implements mitsuba::Renderer.
Configure the camera (manual)
Implements mitsuba::Renderer.
|
virtual |
Set the color value that is written by clear()
Implements mitsuba::Renderer.
|
virtual |
Set the depth value that is written by clear()
Implements mitsuba::Renderer.
Set the current fixed-function pipeline color.
Implements mitsuba::Renderer.
Set the current fixed-function pipeline color.
Implements mitsuba::Renderer.
|
virtual |
Set the currently active culling mode.
Implements mitsuba::Renderer.
|
virtual |
Activate or deactivate the writing of depth information.
Implements mitsuba::Renderer.
|
virtual |
Activate or deactivate depth testing.
Implements mitsuba::Renderer.
|
virtual |
Directly set the modelview or projection matrix.
Implements mitsuba::Renderer.
|
virtual |
Set the size of point primitives.
Implements mitsuba::Renderer.
|
virtual |
Shut the renderer down.
Reimplemented from mitsuba::Renderer.
Reimplemented in mitsuba::NSGLRenderer, mitsuba::WGLRenderer, and mitsuba::GLXRenderer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |