#pragma once #include "material.hpp" /*! \brief A Material that can be assigned to an Intersectable (typically a TriangleMesh), and contains a texture. The texture must be square (equal height and width), 32bpp, BGRA. */ class TexturedMaterial : public Material { unsigned char* pdata; int pitch; int imageSize; public: /*! \brief Constructor. \param pdata pointer to the memory containing the image \param pitch Number of bytes in a row. (Containg padding zeros, if any.) \param textureSize Width and height in pixels. (Width and height must be equal.) */ TexturedMaterial(void* pdata, int pitch, int textureSize); ~TexturedMaterial(void); Vector getTextureDiffuseBrdf(const Vector& atPoint) const; Vector getTextureIdealBrdf(const Vector& atPoint) const; float getTextureDiffuseAlbedo(const Vector& uv) const; float getTextureIdealAlbedo(const Vector& uv) const; };