| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- //__________________________ Banshee Project - A modern game development toolkit _________________________________//
- //_____________________________________ www.banshee-project.com __________________________________________________//
- //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsCoreThreadAccessor.h"
- #include "BsColor.h"
- #include "BsIReflectable.h"
- namespace BansheeEngine
- {
- /**
- * @brief Class defining a single pass of a technique (of a material), i.e.
- * a single rendering call.
- *
- * Pass may contain multiple GPU programs (vertex, fragment, geometry, etc.), and
- * a set of pipeline states (blend, rasterizer, etc.).
- */
- class BS_CORE_EXPORT Pass : public IReflectable
- {
- public:
- Pass();
- Pass(const Pass& oth);
- Pass& operator=(const Pass& oth);
- virtual ~Pass();
- bool hasVertexProgram() const { return mVertexProgram != nullptr; }
- bool hasFragmentProgram() const { return mFragmentProgram != nullptr; }
- bool hasGeometryProgram() const { return mGeometryProgram != nullptr; }
- bool hasHullProgram() const { return mHullProgram != nullptr; }
- bool hasDomainProgram() const { return mDomainProgram != nullptr; }
- bool hasComputeProgram() const { return mComputeProgram != nullptr; }
- /**
- * @brief Returns true if this pass has some element of transparency.
- */
- bool isTransparent() const;
- void setBlendState(HBlendState& blendState);
- HBlendState getBlendState() const;
- void setRasterizerState(HRasterizerState& rasterizerState);
- HRasterizerState getRasterizerState() const;
- void setDepthStencilState(HDepthStencilState& depthStencilState);
- HDepthStencilState getDepthStencilState() const;
- /**
- * @brief Sets the stencil reference value that is used when performing operations using the
- * stencil buffer.
- */
- void setStencilRefValue(UINT32 refValue);
- /**
- * @brief Gets the stencil reference value that is used when performing operations using the
- * stencil buffer.
- */
- UINT32 getStencilRefValue() const;
- void setVertexProgram(HGpuProgram gpuProgram) { mVertexProgram = gpuProgram; }
- const HGpuProgram& getVertexProgram() const { return mVertexProgram; }
- void setFragmentProgram(HGpuProgram gpuProgram) { mFragmentProgram = gpuProgram; }
- const HGpuProgram& getFragmentProgram() const { return mFragmentProgram; }
- void setGeometryProgram(HGpuProgram gpuProgram) { mGeometryProgram = gpuProgram; }
- const HGpuProgram& getGeometryProgram() const { return mGeometryProgram; }
- void setHullProgram(HGpuProgram gpuProgram) { mHullProgram = gpuProgram; }
- const HGpuProgram& getHullProgram(void) const { return mHullProgram; }
- void setDomainProgram(HGpuProgram gpuProgram) { mDomainProgram = gpuProgram;}
- const HGpuProgram& getDomainProgram(void) const { return mDomainProgram; }
- void setComputeProgram(HGpuProgram gpuProgram) { mComputeProgram = gpuProgram; }
- const HGpuProgram& getComputeProgram(void) const { return mComputeProgram; }
- protected:
- HBlendState mBlendState;
- HRasterizerState mRasterizerState;
- HDepthStencilState mDepthStencilState;
- UINT32 mStencilRefValue;
- HGpuProgram mVertexProgram;
- HGpuProgram mFragmentProgram;
- HGpuProgram mGeometryProgram;
- HGpuProgram mHullProgram;
- HGpuProgram mDomainProgram;
- HGpuProgram mComputeProgram;
- /************************************************************************/
- /* RTTI */
- /************************************************************************/
- public:
- friend class PassRTTI;
- static RTTITypeBase* getRTTIStatic();
- virtual RTTITypeBase* getRTTI() const;
- };
- }
|