source: GTP/trunk/App/Demos/Illum/pathmap/TexturedMaterial.h @ 2197

Revision 2197, 914 bytes checked in by szirmay, 18 years ago (diff)
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.
6The texture must be square (equal height and width), 32bpp, BGRA.
7*/
8class TexturedMaterial :
9        public Material
10{
11        unsigned char* pdata;
12        int pitch;
13        int imageSize;
14public:
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.