renderObjectMgr.cpp
Engine/source/renderInstance/renderObjectMgr.cpp
Public Functions
ConsoleDocClass(RenderObjectMgr , "@brief A <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> bin which uses object callbacks <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering.\n\n</a>" "This <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> bin gathers object <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> instances and calls its delegate " "method <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> perform rendering. It is used infrequently <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> specialized " "scene objects which perform custom <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering.\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RenderBin\n</a>" )
Detailed Description
Public Functions
ConsoleDocClass(RenderObjectMgr , "@brief A <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> bin which uses object callbacks <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering.\n\n</a>" "This <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> bin gathers object <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> instances and calls its delegate " "method <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> perform rendering. It is used infrequently <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> specialized " "scene objects which perform custom <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering.\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RenderBin\n</a>" )
IMPLEMENT_CONOBJECT(RenderObjectMgr )
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#include "renderObjectMgr.h" 24#include "console/consoleTypes.h" 25#include "scene/sceneObject.h" 26#include "materials/materialManager.h" 27#include "scene/sceneRenderState.h" 28 29IMPLEMENT_CONOBJECT(RenderObjectMgr); 30 31ConsoleDocClass( RenderObjectMgr, 32 "@brief A render bin which uses object callbacks for rendering.\n\n" 33 "This render bin gathers object render instances and calls its delegate " 34 "method to perform rendering. It is used infrequently for specialized " 35 "scene objects which perform custom rendering.\n\n" 36 "@ingroup RenderBin\n" ); 37 38 39RenderObjectMgr::RenderObjectMgr() 40: RenderBinManager(RenderPassManager::RIT_Object, 1.0f, 1.0f) 41{ 42 mOverrideMat = NULL; 43} 44 45RenderObjectMgr::RenderObjectMgr(RenderInstType riType, F32 renderOrder, F32 processAddOrder) 46 : RenderBinManager(riType, renderOrder, processAddOrder) 47{ 48 mOverrideMat = NULL; 49} 50 51void RenderObjectMgr::initPersistFields() 52{ 53 Parent::initPersistFields(); 54} 55 56void RenderObjectMgr::setOverrideMaterial(BaseMatInstance* overrideMat) 57{ 58 mOverrideMat = overrideMat; 59} 60 61//----------------------------------------------------------------------------- 62// render objects 63//----------------------------------------------------------------------------- 64void RenderObjectMgr::render( SceneRenderState *state ) 65{ 66 PROFILE_SCOPE(RenderObjectMgr_render); 67 68 // Early out if nothing to draw. 69 if(!mElementList.size()) 70 return; 71 72 // Check if bin is disabled in advanced lighting. 73 if ( MATMGR->getDeferredEnabled() && mBasicOnly ) 74 return; 75 76 for( U32 i=0; i<mElementList.size(); i++ ) 77 { 78 ObjectRenderInst *ri = static_cast<ObjectRenderInst*>(mElementList[i].inst); 79 if ( ri->renderDelegate ) 80 ri->renderDelegate( ri, state, mOverrideMat ); 81 } 82} 83