20 #if !defined(__MITSUBA_HW_RENDERER_H_)
21 #define __MITSUBA_HW_RENDERER_H_
58 memset(m_capabilities, 0,
sizeof(m_capabilities));
62 m_capabilities[cap] = supported;
66 return m_capabilities[cap];
73 bool m_capabilities[ECapabilityCount];
108 return m_capabilities.get();
122 virtual void reconfigure(
const Device *device) = 0;
125 virtual void shutdown();
128 virtual GPUTexture *createGPUTexture(
const std::string &name,
129 Bitmap *bitmap = NULL) = 0;
132 virtual GPUProgram *createGPUProgram(
const std::string &name) = 0;
135 virtual GPUSync *createGPUSync() = 0;
138 virtual void clear() = 0;
144 Float timeSample = 0.5f) = 0;
150 virtual void setMatrix(EMatrixType type,
const Matrix4x4 &value) = 0;
153 virtual Matrix4x4 getMatrix(EMatrixType type)
const = 0;
156 virtual void beginDrawingMeshes(
bool transmitOnlyPositions =
false) = 0;
159 virtual void drawMesh(
const TriMesh *shape) = 0;
165 virtual void endDrawingMeshes() = 0;
174 virtual void drawAll(
const std::vector<TransformedGPUGeometry> &geo) = 0;
177 virtual void blitTexture(
const GPUTexture *texture,
178 bool flipVertically =
false,
179 bool centerHoriz =
true,
bool centerVert =
true,
183 virtual void blitQuad(
bool flipVertically) = 0;
189 virtual void drawText(
const Point2i &pos,
190 const Font *font,
const std::string &text) = 0;
193 virtual void setPointSize(
Float size) = 0;
196 virtual void drawPoint(
const Point &p) = 0;
199 virtual void drawLine(
const Point &a,
const Point &b) = 0;
202 virtual void drawPoint(
const Point2 &p) = 0;
205 virtual void drawPoint(
const Point2i &p) = 0;
208 virtual void drawLine(
const Point2 &a,
const Point2 &b) = 0;
214 virtual void drawRectangle(
const Point2 &a,
const Point2 &b) = 0;
217 virtual void drawRectangle(
const Point2i &a,
const Point2i &b) = 0;
220 virtual void drawFilledRectangle(
const Point2 &a,
const Point2 &b) = 0;
223 virtual void drawFilledRectangle(
const Point2i &a,
const Point2i &b) = 0;
226 virtual void drawEllipse(
const Point ¢er,
230 virtual void drawAABB(
const AABB &aabb) = 0;
233 virtual void setBlendMode(EBlendMode mode) = 0;
236 virtual void setCullMode(ECullMode mode) = 0;
239 virtual void setDepthTest(
bool value) = 0;
242 virtual void setDepthMask(
bool value) = 0;
245 virtual void setColor(
const Color3 &color,
Float alpha = 1.0f) = 0;
248 virtual void setColor(
const Spectrum &spec,
Float alpha = 1.0f) = 0;
251 virtual void setClearDepth(
Float depth) = 0;
254 virtual void setClearColor(
const Color3 &color) = 0;
257 virtual void clearTransforms() = 0;
260 virtual void flush() = 0;
263 virtual void finish() = 0;
266 virtual void checkError(
bool onlyWarn =
true) = 0;
281 void unregisterShaderForResource(
const HWResource *res);
294 bool unregisterGeometry(
const Shape *shape);
308 virtual void debugString(
const std::string &text) = 0;
Shader * shader
Definition: renderer.h:320
TVector2< int > Vector2i
Definition: fwd.h:108
EBlendMode
Definition: renderer.h:84
ref< Session > m_session
Definition: renderer.h:323
ELogLevel m_warnLogLevel
Definition: renderer.h:332
void setWarnLogLevel(ELogLevel logLevel)
Set the log level for warnings.
Definition: renderer.h:300
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
Definition: renderer.h:318
Shader base class for use with a VPL-style renderer.
Definition: shader.h:54
ECapability
Definition: renderer.h:42
Utility class used to render text inside OpenGL programs using pre-rasterized TrueType fonts stored a...
Definition: font.h:34
std::pair< const GPUGeometry *, Matrix4x4 > TransformedGPUGeometry
Definition: renderer.h:81
Helper class, which documents the capabilities of a renderer implementation.
Definition: renderer.h:40
std::string m_driverVersion
Definition: renderer.h:331
Front-face culling.
Definition: renderer.h:93
Abstract GPU synchronization object implementing a memory fence operation.
Definition: gpusync.h:31
RendererCapabilities()
Definition: renderer.h:57
Abstract hardware resource.
Definition: shader.h:39
std::string m_driverRenderer
Definition: renderer.h:330
Definition: renderer.h:50
ref< Device > m_device
Definition: renderer.h:324
Abstract shader program (for fragment/vertex shading)
Definition: gpuprogram.h:30
std::string m_driverVendor
Definition: renderer.h:329
Abstract base class of all shapes.
Definition: shape.h:178
RGB color data type.
Definition: spectrum.h:612
ref< RendererCapabilities > m_capabilities
Definition: renderer.h:325
TPoint2< Float > Point2
Definition: fwd.h:129
Projective camera interface.
Definition: sensor.h:393
An abstract drawing device.
Definition: device.h:136
Axis-aligned bounding box data structure in three dimensions.
Definition: aabb.h:437
Definition: renderer.h:48
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Definition: renderer.h:46
ECullMode
Possible culling modes.
Definition: renderer.h:91
Reference counting helper.
Definition: ref.h:40
Definition: renderer.h:49
Definition: renderer.h:53
Abstract renderer implementation.
Definition: renderer.h:79
ELogLevel
Available Log message types.
Definition: formatter.h:28
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
Abstract geometry storage on a graphics card.
Definition: gpugeometry.h:32
bool m_initialized
Definition: renderer.h:328
Basic 4x4 matrix data type.
Definition: matrix.h:656
Normal alpha blending.
Definition: renderer.h:86
Definition: renderer.h:51
std::map< const HWResource *, ShaderRecord > m_shaders
Definition: renderer.h:326
void setLogLevel(ELogLevel logLevel)
Set the log level.
Definition: renderer.h:297
EMatrixType
Matrices of the fixed function pipeline.
Definition: renderer.h:98
void setSupported(ECapability cap, bool supported)
Definition: renderer.h:61
Parent of all Mitsuba classes.
Definition: object.h:38
int refCount
Definition: renderer.h:319
Definition: renderer.h:52
bool isSupported(ECapability cap) const
Definition: renderer.h:65
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
virtual std::string toString() const
Return a human-readable string representation of the object's contents.
Definition: renderer.h:47
const RendererCapabilities * getCapabilities() const
Return the renderer's capabilities.
Definition: renderer.h:107
Definition: renderer.h:44
Definition: renderer.h:45
std::map< const Shape *, GPUGeometry * > m_geometry
Definition: renderer.h:327