Line | |
---|
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 imageWidth;
|
---|
14 | int imageHeight;
|
---|
15 | public:
|
---|
16 | /*!
|
---|
17 | \brief Constructor.
|
---|
18 | \param pdata pointer to the memory containing the image
|
---|
19 | \param pitch Number of bytes in a row. (Containg padding zeros, if any.)
|
---|
20 | \param textureSize Width and height in pixels. (Width and height must be equal.)
|
---|
21 | */
|
---|
22 | TexturedMaterial(void* pdata, int pitch, int textureWidth, int textureHeight);
|
---|
23 | ~TexturedMaterial(void);
|
---|
24 | Vector getTextureDiffuseBrdf(const Vector& atPoint) const;
|
---|
25 | Vector getTextureIdealBrdf(const Vector& atPoint) const;
|
---|
26 | float getTextureDiffuseAlbedo(const Vector& uv) const; |
---|
27 | float getTextureIdealAlbedo(const Vector& uv) const; |
---|
28 | };
|
---|
Note: See
TracBrowser
for help on using the repository browser.