#ifndef shaveRenderer_h #define shaveRenderer_h // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 #include #include "shaveConstant.h" #include "shaveGlobals.h" class shaveHairShape; class shaveRenderer { public: shaveRenderer(); virtual ~shaveRenderer(); virtual void doShutter( const MTime& curTime, shaveConstant::ShutterState shutter ); virtual void frameEnd(const shaveGlobals::Globals& g); virtual void frameStart(const shaveGlobals::Globals& g); virtual shaveConstant::RenderMode getFilteredRenderMode( const MObjectArray& shaveNodes, bool* renderInstances = NULL ) const; virtual shaveConstant::RenderMode getBaseRenderMode(bool* renderInstances = NULL) const; virtual shaveConstant::ShadowSource getBaseShadowSource() const; virtual void getGeomVisibility( bool& hairPrimaryVisibility, bool& hairSecondaryVisibility, bool& instancePrimaryVisibility, bool& instanceSecondaryVisibility ); virtual float getPixelAspect() const; virtual void getRenderableShaveNodes(MObjectArray& nodes); virtual void getRenderableShaveNodesByRenderMode( MObjectArray* geomNodes, MObjectArray* nonGeomNodes ); virtual shaveConstant::RenderMode getRenderMode(bool* renderInstances = NULL) const; virtual shaveConstant::ShadowSource getShadowSource() const; // // This method must return true if the shaveHairShape is to be rendered // as normal Maya geometry and therefore does not need to be included // in a Shave buffer render and should not be included in exported DRA // archives. // virtual bool isGeomNode(const shaveHairShape* nodePtr) const = 0; virtual bool needVertexColours() const; virtual void render( float frame, shaveConstant::ShutterState shutter, const MDagPath& camera ) = 0; virtual void renderEnd(); virtual void renderInterrupted(); virtual void renderStart(); virtual void timeChange(const MTime& newTime) = 0; protected: MObjectArray mGeometryNodes; MObjectArray mNonGeometryNodes; bool mRendering; mutable bool mWarningGivenInvalidHairMode; mutable bool mWarningGivenInvalidInstanceMode; // // Note that these are only valid between startRender and endRender. // shaveConstant::RenderMode mHairRenderMode; bool mHaveHair; bool mHaveInstances; bool mRenderInstances; shaveConstant::ShadowSource mHairShadowSource; }; #endif