mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 12:44:46 +00:00
Added navigation history to AB, as well as ability to navigate via forward and backward buttons and breadcrumb buttons Added folder 'asset type', allowing you to create, rename, delete and move folders via the asset browser for better organization Adjusted various behaviors to work with the address-driven navigation/organization of the AB Expanded visibility options for the AB and integrated them into editor settings so they are retained Added Search field for searching the folder structure, in addition to the existing preview tiles search Adjusted drag-n-drop behavior of the platform code so it accepts dropping folders Added ability to dump active PostEffects list to see what is currently running Added ability to mark specific items in GuiTreeViewCtrl as hidden Made reflection probe bounds boxes translucent rather than wireframe to improve editing visibility Added expanded loose file references to LevelAsset for common companion files like decals and posteffect scrips Added editor setting for Editor Layout Mode, allowing you to set the editor into 'Modern' layout. Added editor settings to set default import config ruleset, and also ability to set auto-import. If both of these are set, then as long as the importing assets have no errors, they will auto-process and the user doesn't need to manually check and confirm them via the asset import window
143 lines
4.5 KiB
C++
143 lines
4.5 KiB
C++
//-----------------------------------------------------------------------------
|
|
// Copyright (c) 2012 GarageGames, LLC
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to
|
|
// deal in the Software without restriction, including without limitation the
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in
|
|
// all copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
// IN THE SOFTWARE.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef _POSTEFFECTMANAGER_H_
|
|
#define _POSTEFFECTMANAGER_H_
|
|
|
|
#ifndef _GFXDEVICE_H_
|
|
#include "gfx/gfxDevice.h"
|
|
#endif
|
|
#ifndef _TVECTOR_H_
|
|
#include "core/util/tVector.h"
|
|
#endif
|
|
#ifndef _TDICTIONARY_H_
|
|
#include "core/util/tDictionary.h"
|
|
#endif
|
|
#ifndef _TSINGLETON_H_
|
|
#include "core/util/tSingleton.h"
|
|
#endif
|
|
#ifndef _POSTEFFECTCOMMON_H_
|
|
#include "postFx/postEffectCommon.h"
|
|
#endif
|
|
|
|
class PostEffect;
|
|
class RenderBinManager;
|
|
class SceneRenderState;
|
|
class SceneManager;
|
|
|
|
|
|
class PostEffectManager
|
|
{
|
|
protected:
|
|
|
|
friend class PostEffect;
|
|
|
|
typedef Vector<PostEffect*> EffectVector;
|
|
|
|
typedef Map<String,EffectVector> EffectMap;
|
|
|
|
/// A global flag for toggling the post effect system. It
|
|
/// is tied to the $pref::enablePostEffects preference.
|
|
static bool smRenderEffects;
|
|
|
|
EffectVector mEndOfFrameList;
|
|
EffectVector mAfterDiffuseList;
|
|
EffectMap mAfterBinMap;
|
|
EffectMap mBeforeBinMap;
|
|
|
|
/// A copy of the last requested back buffer.
|
|
GFXTexHandle mBackBufferCopyTex;
|
|
|
|
//GFXTexHandle mBackBufferFloatCopyTex;
|
|
|
|
/// The target at the time the last back buffer
|
|
/// was copied. Used to detect the need to recopy.
|
|
GFXTarget *mLastBackBufferTarget;
|
|
|
|
// State for current frame and last frame
|
|
bool mFrameStateSwitch;
|
|
|
|
PFXFrameState mFrameState[2];
|
|
|
|
bool _handleDeviceEvent( GFXDevice::GFXDeviceEventType evt );
|
|
|
|
void _handleBinEvent( RenderBinManager *bin,
|
|
const SceneRenderState* sceneState,
|
|
bool isBinStart );
|
|
|
|
///
|
|
void _onPostRenderPass( SceneManager *sceneGraph, const SceneRenderState *sceneState );
|
|
|
|
// Helper method
|
|
void _updateResources();
|
|
|
|
///
|
|
static S32 _effectPrioritySort( PostEffect* const*e1, PostEffect* const*e2 );
|
|
|
|
bool _addEffect( PostEffect *effect );
|
|
|
|
bool _removeEffect( PostEffect *effect );
|
|
|
|
public:
|
|
|
|
PostEffectManager();
|
|
|
|
virtual ~PostEffectManager();
|
|
|
|
void renderEffects( const SceneRenderState *state,
|
|
const PFXRenderTime effectTiming,
|
|
const String &binName = String::EmptyString );
|
|
|
|
/// Returns the current back buffer texture taking
|
|
/// a copy of if the target has changed or the buffer
|
|
/// was previously released.
|
|
GFXTextureObject* getBackBufferTex();
|
|
|
|
/// Releases the current back buffer so that a
|
|
/// new copy is made on the next request.
|
|
void releaseBackBufferTex();
|
|
|
|
/*
|
|
bool submitEffect( PostEffect *effect, const PFXRenderTime renderTime = PFXDefaultRenderTime, const GFXRenderBinTypes afterBin = GFXBin_DefaultPostProcessBin )
|
|
{
|
|
return _addEntry( effect, false, renderTime, afterBin );
|
|
}
|
|
*/
|
|
|
|
// State interface
|
|
const PFXFrameState &getFrameState() const { return mFrameState[mFrameStateSwitch]; }
|
|
const PFXFrameState &getLastFrameState() const { return mFrameState[!mFrameStateSwitch]; }
|
|
|
|
void setFrameState(const PFXFrameState& newState) { mFrameState[mFrameStateSwitch] = newState; }
|
|
void setFrameMatrices( const MatrixF &worldToCamera, const MatrixF &cameraToScreen );
|
|
|
|
// For ManagedSingleton.
|
|
static const char* getSingletonName() { return "PostEffectManager"; }
|
|
|
|
void dumpActivePostFX();
|
|
};
|
|
|
|
/// Returns the PostEffectManager singleton.
|
|
#define PFXMGR ManagedSingleton<PostEffectManager>::instance()
|
|
|
|
#endif // _POSTEFFECTMANAGER_H_
|