Re-submission of the Volumetric Fog PR, with cleanup.

This commit is contained in:
Areloch 2015-12-01 00:10:13 -06:00
parent 272e3138a0
commit a90eb9762b
62 changed files with 2541 additions and 6 deletions

View file

@ -321,8 +321,11 @@ void GuiCanvas::setWindowTitle(const char *newTitle)
mPlatformWindow->setCaption(newTitle);
}
CanvasSizeChangeSignal GuiCanvas::smCanvasSizeChangeSignal;
void GuiCanvas::handleResize( WindowId did, S32 width, S32 height )
{
getCanvasSizeChangeSignal().trigger(this);
if (Journal::IsPlaying() && mPlatformWindow)
{
mPlatformWindow->lockSize(false);

View file

@ -33,6 +33,10 @@
#include "platform/platformInput.h"
#endif
#ifndef _SIGNAL_H_
#include "core/util/tSignal.h"
#endif
#include "component/interfaces/IProcessInput.h"
#include "windowManager/platformWindowMgr.h"
#include "gfx/gfxFence.h"
@ -74,6 +78,8 @@
/// screen will be painted normally. If you are making an animated GuiControl
/// you need to add your control to the dirty areas of the canvas.
///
class guiCanvas;
typedef Signal<void(GuiCanvas* canvas)> CanvasSizeChangeSignal;
class GuiCanvas : public GuiControl, public IProcessInput
{
@ -183,6 +189,8 @@ protected:
virtual void setupFences();
void checkLockMouseMove( const GuiEvent& event );
//Signal used to let others know this canvas has changed size.
static CanvasSizeChangeSignal smCanvasSizeChangeSignal;
GuiControl *mMenuBarCtrl;
@ -200,6 +208,8 @@ public:
static void initPersistFields();
static CanvasSizeChangeSignal& getCanvasSizeChangeSignal() { return smCanvasSizeChangeSignal; }
/// @name Rendering methods
///
/// @{

View file

@ -53,6 +53,7 @@ const RenderInstType RenderPassManager::RIT_ObjectTranslucent("ObjectTranslucent
const RenderInstType RenderPassManager::RIT_Decal("Decal");
const RenderInstType RenderPassManager::RIT_Water("Water");
const RenderInstType RenderPassManager::RIT_Foliage("Foliage");
const RenderInstType RenderPassManager::RIT_VolumetricFog("ObjectVolumetricFog");
const RenderInstType RenderPassManager::RIT_Translucent("Translucent");
const RenderInstType RenderPassManager::RIT_Begin("Begin");
const RenderInstType RenderPassManager::RIT_Custom("Custom");

View file

@ -110,6 +110,7 @@ public:
static const RenderInstType RIT_Decal;
static const RenderInstType RIT_Water;
static const RenderInstType RIT_Foliage;
static const RenderInstType RIT_VolumetricFog;
static const RenderInstType RIT_Translucent;
static const RenderInstType RIT_Begin;
static const RenderInstType RIT_Custom;

View file

@ -51,6 +51,7 @@ RenderTranslucentMgr::RenderTranslucentMgr()
{
notifyType( RenderPassManager::RIT_ObjectTranslucent );
notifyType( RenderPassManager::RIT_Particle );
notifyType( RenderPassManager::RIT_VolumetricFog);
}
RenderTranslucentMgr::~RenderTranslucentMgr()
@ -187,6 +188,15 @@ void RenderTranslucentMgr::render( SceneRenderState *state )
j++;
continue;
}
else if (baseRI->type == RenderPassManager::RIT_VolumetricFog)
{
ObjectRenderInst* objRI = static_cast<ObjectRenderInst*>(baseRI);
objRI->renderDelegate(objRI, state, NULL);
lastVB = NULL;
lastPB = NULL;
j++;
continue;
}
else if ( baseRI->type == RenderPassManager::RIT_Particle )
{
ParticleRenderInst *ri = static_cast<ParticleRenderInst*>(baseRI);

View file

@ -22,7 +22,7 @@
#include "windowManager/platformWindow.h"
ScreenResChangeSignal PlatformWindow::smScreenResChangeSignal;
//-----------------------------------------------------------------------------
void PlatformWindow::setFullscreen( const bool fullscreen )
@ -48,3 +48,8 @@ bool PlatformWindow::shouldNotTranslate( U32 modifiers, U32 keyCode ) const
else
return false;
}
void PlatformWindow::setVideoMode(const GFXVideoMode &mode)
{
_setVideoMode(mode);
getScreenResChangeSignal().trigger(this, true);
}

View file

@ -28,6 +28,9 @@
#include "core/util/safeDelete.h"
#include "windowManager/platformCursorController.h"
#include "windowManager/windowInputGenerator.h"
#ifndef _SIGNAL_H_ //Volumetric Fog
#include "core/util/tSignal.h"
#endif
//forward decl's
class PlatformWindowManager;
@ -35,7 +38,7 @@ class GFXDevice;
struct GFXVideoMode;
class GFXWindowTarget;
class IProcessInput;
typedef Signal<void(PlatformWindow *PlatformWindow, bool resize)> ScreenResChangeSignal;
/// Abstract representation of a native OS window.
///
/// Every windowing system has its own representations and conventions as
@ -110,7 +113,7 @@ protected:
// This controller maps window input (Mouse/Keyboard) to a generic input consumer
mWindowInputGenerator = new WindowInputGenerator( this );
}
static ScreenResChangeSignal smScreenResChangeSignal;
public:
/// To get rid of a window, just delete it. Make sure the GFXDevice is
@ -158,7 +161,7 @@ public:
virtual GFXWindowTarget *getGFXTarget()=0;
/// Set the video mode for this window.
virtual void setVideoMode(const GFXVideoMode &mode)=0;
virtual void setVideoMode(const GFXVideoMode &mode);
/// Get our current video mode - if the window has been resized, it will
/// reflect this.
@ -497,6 +500,7 @@ public:
IdleEvent idleEvent;
/// @}
static ScreenResChangeSignal& getScreenResChangeSignal() { return smScreenResChangeSignal; }
/// Get the platform specific object needed to create or attach an accelerated
/// graohics drawing context on or to the window
@ -507,6 +511,7 @@ public:
virtual void* getPlatformDrawable() const = 0;
protected:
virtual void _setFullscreen(const bool fullScreen) {};
virtual void _setVideoMode(const GFXVideoMode &mode) {};
};
#endif

View file

@ -287,6 +287,8 @@ void Win32Window::setVideoMode( const GFXVideoMode &mode )
mOwningManager->raiseCurtain();
SetForegroundWindow(getHWND());
getScreenResChangeSignal().trigger(this, true);
}
bool Win32Window::clearFullscreen()