#ifndef _HAIR_VR_tri_SHADEABLE_H_ #define _HAIR_VR_tri_SHADEABLE_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 /********************************************************************** *< FILE: shaveVrayTriShadeable.h DESCRIPTION: Used by VRay to shade instanced surface CREATED BY: Vladimir Dubovoy HISTORY: created 13-05-2010 *> **********************************************************************/ #include "utils.h" #include "box.h" #include "rayserver.h" #include "vrayplugins.h" #include "rayserver.h" #include "geometryclasses.h" #include "brdfs.h" #include "brdfpool.h" #include "shaveVrayTriVoxelPrim.h" //#include "shaveVrayBaseBSDF.h" #define USE_WHITE_TRI_BRDF class shaveVrayTriShadeable : public VR::BSDFShadeable { public: shaveVrayTriShadeable(shaveVrayTriVoxelPrim* instanced); ~shaveVrayTriShadeable(); /* | from Shadeable */ // This is called to shade the intersection in the rayresult member of the given context. void shade(VR::VRayContext &rc); //Returns the name of the shadeable; used to print warnings if any shading errors occur. tchar* getName(VR::VRayContext &rc); /* | */ VR::BSDFSampler* newBSDF (const VR::VRayContext &rc, VR::BSDFFlags flags); void deleteBSDF(const VR::VRayContext &rc, VR::BSDFSampler *bsdf); /* | own */ void initBSDFpool(VR::VRayCore *vray); void freeBSDFpool(); #if defined VRAY40 int getBSDFFlags() VRAY_OVERRIDE; #endif protected: //const member access #ifdef USE_WHITE_TRI_BRDF inline const VR::BRDFPool& bsdfPool() const {return m_bsdfPool;} #else inline const VR::BRDFPool& bsdfPool() const {return m_bsdfPool;} #endif inline shaveVrayTriVoxelPrim* prim() const {return m_prim;} //const member access #ifdef USE_WHITE_TRI_BRDF inline VR::BRDFPool& _bsdfPool() {return m_bsdfPool;} #else inline VR::BRDFPool& _bsdfPool() {return m_bsdfPool;} #endif inline shaveVrayTriVoxelPrim*& _prim() {return m_prim;} protected: #ifdef USE_WHITE_TRI_BRDF VR::BRDFPool m_bsdfPool; #else VR::BRDFPool m_bsdfPool; #endif shaveVrayTriVoxelPrim* m_prim; }; #endif //end of_HAIR_VR_tri_SHADEABLE_H_