20 #if !defined(__MITSUBA_HW_GPUTEXTURE_H_)
21 #define __MITSUBA_HW_GPUTEXTURE_H_
68 EColorAndDepthBuffer = 0x03
113 EDefaultPosition = 0,
115 ECubeMapPositiveX = 0,
190 inline void setName(
const std::string &name) { m_name = name; }
193 inline const std::string &
getName()
const {
return m_name; }
214 void setFrameBufferType(EFrameBufferType frameBufferType);
227 setWrapTypeU(wrapType); setWrapTypeV(wrapType);
272 void setBitmap(
unsigned int slot,
Bitmap *bitmap);
275 Bitmap *getBitmap(
unsigned int slot = EDefaultPosition);
278 const Bitmap *getBitmap(
unsigned int slot = EDefaultPosition)
const;
284 virtual void init() = 0;
290 void initAndRelease();
293 virtual void refresh() = 0;
303 virtual void cleanup() = 0;
316 virtual void bind(
int textureUnit = 0,
int textureIndex = 0)
const = 0;
319 virtual void unbind()
const = 0;
326 virtual void download(
Bitmap *bitmap = NULL) = 0;
329 virtual void activateTarget() = 0;
332 virtual void activateSide(
int side) = 0;
335 virtual void setTargetRegion(
const Point2i &offset,
const Vector2i &size) = 0;
338 virtual void releaseTarget() = 0;
363 virtual void blit(
GPUTexture *target,
int what)
const = 0;
383 const Vector2i &destSize)
const = 0;
386 virtual void clear() = 0;
389 virtual Color3 getPixel(
int x,
int y)
const = 0;
bool isMipMapped() const
Return whether mipmapping is enabled.
Definition: gputexture.h:260
Two-channel luminance + alpha bitmap.
Definition: gputexture.h:101
EDepthMode
When this texture contains a depth buffer, the following modes control the read behavior of the assoc...
Definition: gputexture.h:173
const std::set< int > & getTextureUnits() const
Return the texture units, to which this texture is currently bound.
Definition: gputexture.h:341
EDepthMode getDepthMode() const
Return the depth map read mode.
Definition: gputexture.h:266
EFilterType
The interpolation filter determines which texture pixels are considered when shading a fragment...
Definition: gputexture.h:148
void setWrapTypeU(EWrapType wrapType)
Set the wrap type along the U axis.
Definition: gputexture.h:231
General-purpose bitmap class with read and write support for several common file formats.
Definition: bitmap.h:50
void setMipMapped(bool mipMapped)
Define whether mipmapping is enabled.
Definition: gputexture.h:263
int getSampleCount() const
Return the number of samples (for multisample color render targets)
Definition: gputexture.h:347
Definition: gputexture.h:157
RGB bitmap.
Definition: gputexture.h:104
Modulo 1 operation (default)
Definition: gputexture.h:140
void setDepthMode(EDepthMode mode)
Set the depth map read mode.
Definition: gputexture.h:269
Definition: gputexture.h:174
void setPixelFormat(EPixelFormat fmt)
Set the pixel format of this texture.
Definition: gputexture.h:202
void setName(const std::string &name)
Set the texture name.
Definition: gputexture.h:190
ETexturePosition
A texture has one more slots into which bitmaps can be placed.
Definition: gputexture.h:111
3D volume texture format, needs 3D texture coordinates
Definition: gputexture.h:46
Point3i getSize() const
Return the size in pixels.
Definition: gputexture.h:243
16-bit unsigned integer (uint16_t) component encoding
Definition: gputexture.h:77
EFrameBufferType
If the texture type is set to EFrameBuffer, the configuration must be one of the following constants...
Definition: gputexture.h:54
void setType(ETextureType textureType)
Set the texture type.
Definition: gputexture.h:196
Cube map: -X plane, Left.
Definition: gputexture.h:117
ETextureType getType() const
Return the texture type.
Definition: gputexture.h:199
ETextureType
Available texture types.
Definition: gputexture.h:35
RGB color data type.
Definition: spectrum.h:612
Cube map: +Z plane, Front.
Definition: gputexture.h:123
Default 2D texture format, needs 2D texture coordinates.
Definition: gputexture.h:43
EComponentFormat
Supported per-component data formats.
Definition: gputexture.h:72
EPixelFormat getPixelFormat() const
Return the pixel format of this texture.
Definition: gputexture.h:205
void setWrapTypeV(EWrapType wrapType)
Set the wrap type along the V axis.
Definition: gputexture.h:237
const std::string & getName() const
Get the texture name.
Definition: gputexture.h:193
int getBitmapCount() const
Return the number of stored bitmaps.
Definition: gputexture.h:281
Cube map: -Z plane, Back.
Definition: gputexture.h:125
EFrameBufferType getFrameBufferType() const
Return the framebuffer type (applies only if type==EFrameBuffer)
Definition: gputexture.h:217
8-bit unsigned integer (uint8_t) component encoding
Definition: gputexture.h:74
EWrapType getWrapTypeU()
Return the wrap type along the U axis.
Definition: gputexture.h:234
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Similar to EClamp.
Definition: gputexture.h:138
A data structure for 1/2/3D and cube texture mapping. Also has optional render-to-texture functionali...
Definition: gputexture.h:32
Thin wrapper around posix thread local storage. Stores heap-allocated data other than Object instance...
Definition: tls.h:115
void setSampleCount(int samples)
Set the number of samples (for multisample color render targets)
Definition: gputexture.h:344
EWrapType getWrapTypeV()
Return the wrap type along the V axis.
Definition: gputexture.h:240
void setFilterType(EFilterType filterType)
Set the filter type.
Definition: gputexture.h:220
void setComponentFormat(EComponentFormat fmt)
Set the component format of this texture.
Definition: gputexture.h:208
Cube map: +Y plane, Top.
Definition: gputexture.h:119
Use 4 surrounding pixels and weigh them.
Definition: gputexture.h:152
void setBorderColor(const Color3 &borderColor)
Set the border color (applicable if wrapMode=EClamp/EClampToBorder)
Definition: gputexture.h:350
void setSize(const Point3i &size)
Set the size in pixels.
Definition: gputexture.h:246
void setMaxAnisotropy(Float maxAnisotropy)
Set the maximal anisotropy.
Definition: gputexture.h:257
32-bit unsigned integer (uint32_t) component encoding
Definition: gputexture.h:80
No filtering, nearest neighbor lookups.
Definition: mipmap.h:56
Parent of all Mitsuba classes.
Definition: object.h:38
Similar to EClamp, but prevents mixing at the edges.
Definition: gputexture.h:136
Float getMaxAnisotropy() const
Get the maximal anisotropy.
Definition: gputexture.h:249
void setWrapType(EWrapType wrapType)
Set the wrap type.
Definition: gputexture.h:226
EPixelFormat
Supported pixel format types.
Definition: gputexture.h:93
virtual std::string toString() const
Return a human-readable string representation of the object's contents.
EFilterType getFilterType() const
Return the filter type.
Definition: gputexture.h:223
EWrapType
Texture wrapping mode when texture coordinates exit the [0, 1] range.
Definition: gputexture.h:132
const Color3 & getBorderColor() const
Return the border color.
Definition: gputexture.h:353
16-bit floating point (half) HDR component encoding
Definition: gputexture.h:83
Cube map: -Y plane, Bottom.
Definition: gputexture.h:121
Single-channel luminance bitmap.
Definition: gputexture.h:98
EComponentFormat getComponentFormat() const
Return the component format of this texture.
Definition: gputexture.h:211
32-bit floating point (float) HDR component encoding
Definition: gputexture.h:86