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

Revision 2304, 954 bytes checked in by szirmay, 18 years ago (diff)
RevLine 
[2197]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;
[2304]13        int imageWidth;
14        int imageHeight;
[2197]15public:
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        */
[2304]22        TexturedMaterial(void* pdata, int pitch, int textureWidth, int textureHeight);
[2197]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.