#ifndef _HAIR_VR_SHADEABLE_H_ #define _HAIR_VR_SHADEABLE_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 /********************************************************************** *< FILE: shaveVrayShadeable.h ( was HairVrShadeable.h ) DESCRIPTION: Used by VRay to shade a surface CREATED BY: Vladimir Dubovoy HISTORY: created 21-08-2008 ( as part of 3ds Max + VRay hair shaders) merged 31-03-2010 *> **********************************************************************/ //#include //#include //#include //#include //#include //#include //#include #include "hairAPIvrayutil.h" #include "hairAPIvray.h" #include "utils.h" #include "box.h" #include "rayserver.h" #include "vrayplugins.h" #include "geometryclasses.h" #include "brdfs.h" #include "brdfpool.h" #include "shaveVrayVoxelPrim.h" #include "shaveVrayBaseBSDF.h" //#define USE_WHITE_BRDF class shaveVrayShadeable : public /*VR::Shadeable*/ VR::BSDFShadeable { public: shaveVrayShadeable(shaveVrayVoxelPrim* hair); ~shaveVrayShadeable(); /* | from Shadeable */ // This is called to shade the intersection in the rayresult member of the given context. void shade(VR::VRayContext &rc) VRAY_OVERRIDE; //Returns the name of the shadeable; used to print warnings if any shading errors occur. tchar* getName(VR::VRayContext &rc) VRAY_OVERRIDE; /* | */ VR::BSDFSampler* newBSDF (const VR::VRayContext &rc, VR::BSDFFlags flags) VRAY_OVERRIDE; void deleteBSDF(const VR::VRayContext &rc, VR::BSDFSampler *bsdf) VRAY_OVERRIDE; #if defined VRAY40 int getBSDFFlags() VRAY_OVERRIDE; #endif /* | own */ void initBSDFpool(VR::VRayCore *vray); void freeBSDFpool(); protected: //const member access #ifdef USE_WHITE_BRDF inline const VR::BRDFPool& bsdfPool() const {return m_bsdfPool;} #else //inline const VR::BRDFPool& bsdfPool() const {return m_bsdfPool;} inline IShaveBSDFPool* bsdfPool() {return m_bsdfPool;} #endif inline shaveVrayVoxelPrim* prim() const {return m_prim;} //inline IHairVoxel* prim() const {return m_prim;} //const member access #ifdef USE_WHITE_BRDF inline VR::BRDFPool& _bsdfPool() {return m_bsdfPool;} #else //inline VR::BRDFPool& _bsdfPool() {return m_bsdfPool;} inline IShaveBSDFPool*& _bsdfPool() {return m_bsdfPool;} #endif inline shaveVrayVoxelPrim*& _prim() {return m_prim;} //inline IHairVoxel*& _prim() {return m_prim;} protected: #ifdef USE_WHITE_BRDF VR::BRDFPool m_bsdfPool; #else //VR::BRDFPool m_bsdfPool; IShaveBSDFPool* m_bsdfPool; #endif shaveVrayVoxelPrim* m_prim; //IHairVoxel* m_prim; }; #endif //end of_HAIR_VR_SHADEABLE_H_