Rev | Line | |
---|
[896] | 1 | #pragma once
|
---|
| 2 | #include "material.hpp"
|
---|
| 3 |
|
---|
| 4 | /*!
|
---|
| 5 | \brief A Material that can be assigned to an Intersectable (typically a TriangleMesh), and contains a texture.
|
---|
| 6 | The texture must be square (equal height and width), 32bpp, BGRA.
|
---|
| 7 | */
|
---|
| 8 | class TexturedMaterial :
|
---|
| 9 | public Material
|
---|
| 10 | {
|
---|
| 11 | unsigned char* pdata;
|
---|
| 12 | int pitch;
|
---|
| 13 | int imageSize;
|
---|
| 14 | public:
|
---|
| 15 | /*!
|
---|
| 16 | \brief Constructor.
|
---|
| 17 | \param pdata pointer to the memory containing the image
|
---|
| 18 | \param pitch Number of bytes in a row. (Containg padding zeros, if any.)
|
---|
| 19 | \param textureSize Width and height in pixels. (Width and height must be equal.)
|
---|
| 20 | */
|
---|
| 21 | TexturedMaterial(void* pdata, int pitch, int textureSize);
|
---|
| 22 | ~TexturedMaterial(void);
|
---|
| 23 | Vector getTextureDiffuseBrdf(const Vector& atPoint) const;
|
---|
| 24 | Vector getTextureIdealBrdf(const Vector& atPoint) const;
|
---|
| 25 | float getTextureDiffuseAlbedo(const Vector& uv) const; |
---|
| 26 | float getTextureIdealAlbedo(const Vector& uv) const; |
---|
| 27 | };
|
---|
Note: See
TracBrowser
for help on using the repository browser.