Side by side rendering

- Side by side rendering implemented throughout the graphics pipeline.
- New GuiTSCtrl renderStyle property is set to "stereo side by side" to
activate.
- You set an IDisplayDevice on the GameConnection to define any vertical
FOV, projection offset, and stereo eye offset properties required for
the stereo rendering (no display device included with this commit).
- Full and Empty templates updated with correct scripts and shaders.
This commit is contained in:
DavidWyand-GG 2013-04-09 15:19:18 -04:00
parent b1feed56fd
commit b32e7688c2
28 changed files with 465 additions and 41 deletions

View file

@ -159,6 +159,9 @@ GFXDevice::GFXDevice()
// misc
mAllowRender = true;
mCurrentRenderStyle = RS_Standard;
mCurrentProjectionOffset = Point2F::Zero;
mStereoEyeOffset = Point3F::Zero;
mCanCurrentlyRender = false;
mInitialized = false;

View file

@ -231,6 +231,13 @@ private:
//--------------------------------------------------------------------------
// Core GFX interface
//--------------------------------------------------------------------------
public:
enum GFXDeviceRenderStyles
{
RS_Standard = 0,
RS_StereoSideBySide = (1<<0),
};
private:
/// Adapter for this device.
@ -254,6 +261,15 @@ protected:
/// Set if we're in a mode where we want rendering to occur.
bool mAllowRender;
/// The style of rendering that is to be performed, based on GFXDeviceRenderStyles
U32 mCurrentRenderStyle;
/// The current projection offset. May be used during side-by-side rendering, for example.
Point2F mCurrentProjectionOffset;
/// Eye offset used when using a stereo rendering style
Point3F mStereoEyeOffset;
/// This will allow querying to see if a device is initialized and ready to
/// have operations performed on it.
bool mInitialized;
@ -285,6 +301,24 @@ public:
inline bool allowRender() const { return mAllowRender; }
/// Retrieve the current rendering style based on GFXDeviceRenderStyles
U32 getCurrentRenderStyle() const { return mCurrentRenderStyle; }
/// Set the current rendering style, based on GFXDeviceRenderStyles
void setCurrentRenderStyle(U32 style) { mCurrentRenderStyle = style; }
/// Set the current projection offset used during stereo rendering
const Point2F& getCurrentProjectionOffset() { return mCurrentProjectionOffset; }
/// Get the current projection offset used during stereo rendering
void setCurrentProjectionOffset(const Point2F& offset) { mCurrentProjectionOffset = offset; }
/// Get the current eye offset used during stereo rendering
const Point3F& getStereoEyeOffset() { return mStereoEyeOffset; }
/// Set the current eye offset used during stereo rendering
void setStereoEyeOffset(const Point3F& offset) { mStereoEyeOffset = offset; }
GFXCardProfiler* getCardProfiler() const { return mCardProfiler; }
/// Returns active graphics adapter type.