#ifndef _HAIR_VRAY_tri_SHADE_DATA_H_ #define _HAIR_VRAY_tri_SHADE_DATA_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 // V-Ray headers #include "vraybase.h" #include "vraymayageom.h" #include "vrayplugins.h" #include "geometryclasses.h" #include "hairprimitives.h" #include "rayprimitives.h" #include "vray3_compat.h" class shaveVrayInstanceI; class shaveVrayTriShadeData : public VR::BaseShadeData, public VR::MappedSurface { //void getPositionAndBlend(const VR::VRayContext &rc, int &pos, float &blend); public: shaveVrayTriShadeData(shaveVrayInstanceI *instance ); PluginBase* getPlugin(void) VRAY_OVERRIDE { return NULL; } PluginInterface* newInterface(InterfaceID id) VRAY_OVERRIDE { switch (id) { case EXT_MAPPED_SURFACE: return static_cast(this); } return BaseShadeData::newInterface(id); } //VR::Color getColor(const VR::VRayContext &rc); //VR::Color getIncandescence(const VR::VRayContext &rc); //VR::Color getTransparency(const VR::VRayContext &rc); //void getShadeData(const VR::VRayContext &rc, VR::VRayMayaHairShadeData &result); // From MappedSurface #if defined(VRAY30) VR::Transform getLocalUVWTransform(const VR::VRayContext &rc, int channel) VRAY_OVERRIDE; VR::Vector getLocalUVWCoordinates(const VR::VRayContext &rc, int channel) VRAY_OVERRIDE; #elif defined(VRAY40) void getLocalUVWTransform(const VR::VRayContext &rc, int channel, VR::ShadeTransform &result) override; void getLocalUVWCoordinates(const VR::VRayContext &rc, int channel, VR::ShadeVec &result) override; int getLocalUVWTransformByName(const VR::VRayContext &rc, const VR::StringID &channelName, VR::ShadeTransform &result) override; int getUVWCoordinatesByName(const VR::VRayContext &rc, const VR::StringID &channelName, VR::ShadeVec &result) override; VR::ShadeVec getMapChannelVertexVector(int mapChannelIdx, int vertexIdx) override; VR::ShadeVec getUVWcoords(const VR::VRayContext &vri, int channel) override; void getUVWderivs(const VR::VRayContext &vri, int channel, VR::ShadeVec derivs[2]) override; void getUVWbases(const VR::VRayContext &vri, int channel, VR::ShadeVec bases[3]) override; VR::ShadeVec getUVWnormal(const VR::VRayContext &vri, int channel) override; #endif void init(const VR::TraceTransform &itm); private: bool getUVWTriVerts(const VR::VRayContext &rc, VR::ShadeVec &t0, VR::ShadeVec &t1, VR::ShadeVec &t2); protected: VR::TraceTransform itm; }; #endif