renderGlowMgr.h
Engine/source/renderInstance/renderGlowMgr.h
Classes:
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _RENDERGLOWMGR_H_ 25#define _RENDERGLOWMGR_H_ 26 27#ifndef _TEXTARGETBIN_MGR_H_ 28#include "renderInstance/renderTexTargetBinManager.h" 29#endif 30#include <renderInstance/renderParticleMgr.h> 31 32 33class PostEffect; 34 35 36/// 37class RenderGlowMgr : public RenderTexTargetBinManager 38{ 39 typedef RenderTexTargetBinManager Parent; 40 41public: 42 43 RenderGlowMgr(); 44 virtual ~RenderGlowMgr(); 45 46 /// Returns the glow post effect. 47 PostEffect* getGlowEffect(); 48 49 /// Returns true if the glow post effect is 50 /// enabled and the glow buffer should be updated. 51 bool isGlowEnabled(); 52 53 // RenderBinManager 54 virtual void addElement( RenderInst *inst ); 55 virtual void render( SceneRenderState *state ); 56 57 // ConsoleObject 58 DECLARE_CONOBJECT( RenderGlowMgr ); 59 60protected: 61 62 class GlowMaterialHook : public MatInstanceHook 63 { 64 public: 65 66 GlowMaterialHook( BaseMatInstance *matInst ); 67 virtual ~GlowMaterialHook(); 68 69 virtual BaseMatInstance *getMatInstance() { return mGlowMatInst; } 70 71 virtual const MatInstanceHookType& getType() const { return Type; } 72 73 /// Our material hook type. 74 static const MatInstanceHookType Type; 75 76 protected: 77 78 static void _overrideFeatures( ProcessedMaterial *mat, 79 U32 stageNum, 80 MaterialFeatureData &fd, 81 const FeatureSet &features ); 82 83 BaseMatInstance *mGlowMatInst; 84 }; 85 86 SimObjectPtr<PostEffect> mGlowEffect; 87 RenderParticleMgr *mParticleRenderMgr; 88}; 89 90 91#endif // _RENDERGLOWMGR_H_ 92