20 #if !defined(__MITSUBA_HW_GLRENDERER_H_)
21 #define __MITSUBA_HW_GLRENDERER_H_
25 struct GLEWContextStruct;
37 #define MTS_GL_MAX_QUEUED_TRIS 250000
80 Float timeSample = 0.5f);
110 void drawAll(
const std::vector<TransformedGPUGeometry> &allGeometry);
114 bool flipVertically =
false,
115 bool centerHoriz =
true,
bool centerVert =
true,
126 const Font *font,
const std::string &text);
217 bool m_transmitOnlyPositions;
218 bool m_normalsEnabled;
219 bool m_texcoordsEnabled;
220 bool m_tangentsEnabled;
221 bool m_colorsEnabled;
222 size_t m_queuedTriangles;
TVector2< int > Vector2i
Definition: fwd.h:108
EBlendMode
Definition: renderer.h:84
virtual void setCamera(const ProjectiveCamera *pCamera, const Point2 &apertureSample=Point2(0.5f), const Point2 &aaSample=Point2(0.5f), Float timeSample=0.5f)=0
Configure the camera.
virtual void shutdown()
Shut the renderer down.
virtual void flush()=0
Flush outstanding rendering commands.
Abstract triangle mesh base class.
Definition: trimesh.h:68
General-purpose bitmap class with read and write support for several common file formats.
Definition: bitmap.h:50
virtual void beginDrawingMeshes(bool transmitOnlyPositions=false)=0
Set up the renderer for drawing triangle geometry.
virtual void drawEllipse(const Point ¢er, const Vector &axis1, const Vector &axis2)=0
Draw an ellipse with the specified center and axes.
virtual void setBlendMode(EBlendMode mode)=0
Set the currently active blending mode.
Utility class used to render text inside OpenGL programs using pre-rasterized TrueType fonts stored a...
Definition: font.h:34
virtual void drawLine(const Point &a, const Point &b)=0
Draw a line between two specified points.
virtual void clearTransforms()=0
Clear the view and projection transformations.
virtual void drawMesh(const TriMesh *shape)=0
Send a triangle mesh to the renderer.
virtual void checkError(bool onlyWarn=true)=0
Check for any error indications.
virtual void clear()=0
Clear the viewport.
Abstract GPU synchronization object implementing a memory fence operation.
Definition: gpusync.h:31
virtual void setClearColor(const Color3 &color)=0
Set the color value that is written by clear()
virtual void setCullMode(ECullMode mode)=0
Set the currently active culling mode.
virtual void drawText(const Point2i &pos, const Font *font, const std::string &text)=0
virtual GPUProgram * createGPUProgram(const std::string &name)=0
Create a new GPU program object.
virtual GPUTexture * createGPUTexture(const std::string &name, Bitmap *bitmap=NULL)=0
Create a new GPU texture object.
Abstract shader program (for fragment/vertex shading)
Definition: gpuprogram.h:30
Abstract base class of all shapes.
Definition: shape.h:178
RGB color data type.
Definition: spectrum.h:612
virtual void debugString(const std::string &text)=0
Send a debug string to the rendering backend.
virtual void setMatrix(EMatrixType type, const Matrix4x4 &value)=0
Directly set the modelview or projection matrix.
TPoint2< Float > Point2
Definition: fwd.h:129
Projective camera interface.
Definition: sensor.h:393
virtual void blitQuad(bool flipVertically)=0
Blit a screen-sized quad.
An abstract drawing device.
Definition: device.h:136
Axis-aligned bounding box data structure in three dimensions.
Definition: aabb.h:437
GLEWContextStruct * glewGetContext()
Get the per-thread context for GLEW-MX.
virtual Matrix4x4 getMatrix(EMatrixType type) const =0
Fetch the currently set modelview or projection matrix.
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
virtual void finish()=0
Completely finish outstanding rendering commands.
ECullMode
Possible culling modes.
Definition: renderer.h:91
Abstract renderer implementation.
Definition: renderer.h:79
A data structure for 1/2/3D and cube texture mapping. Also has optional render-to-texture functionali...
Definition: gputexture.h:32
Abstract windowing environment session.
Definition: session.h:32
virtual void drawRectangle(const Point2 &a, const Point2 &b)=0
Draw a rectangle between two specified points (2D)
Abstract geometry storage on a graphics card.
Definition: gpugeometry.h:32
Basic 4x4 matrix data type.
Definition: matrix.h:656
virtual GPUGeometry * createGPUGeometry(const Shape *mesh)=0
Create a new GPU geometry object.
virtual void setColor(const Color3 &color, Float alpha=1.0f)=0
Set the current fixed-function pipeline color.
virtual void setDepthMask(bool value)=0
Activate or deactivate the writing of depth information.
virtual GPUSync * createGPUSync()=0
Create a new synchronization object.
virtual void reconfigure(const Device *device)=0
Reconfigure the renderer for a certain device (e.g. after a resize event)
EMatrixType
Matrices of the fixed function pipeline.
Definition: renderer.h:98
virtual void endDrawingMeshes()=0
Clean up the renderer after drawing triangle geometry.
virtual void setDepthTest(bool value)=0
Activate or deactivate depth testing.
virtual void blitTexture(const GPUTexture *texture, bool flipVertically=false, bool centerHoriz=true, bool centerVert=true, const Vector2i &offset=Vector2i(0, 0))=0
Draw a quad using the given texture.
OpenGL implementation of the Renderer interface.
Definition: glrenderer.h:43
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
virtual void setPointSize(Float size)=0
Set the size of point primitives.
virtual void drawPoint(const Point &p)=0
Draw a point.
virtual void drawAABB(const AABB &aabb)=0
Draw a wire-frame axis-aligned box.
virtual void drawAll(const std::vector< TransformedGPUGeometry > &geo)=0
Quickly draw all geometry that has been registered with the renderer.
virtual void drawFilledRectangle(const Point2 &a, const Point2 &b)=0
Draw a filled rectangle between two specified points (2D)
virtual void setClearDepth(Float depth)=0
Set the depth value that is written by clear()
virtual void init(Device *device, Renderer *other=NULL)