Various game engine fixes:

* Fix issue with add transparency mode with blender materials.
* Possible fix at frontface flip in the game engine.
* Fix color buffering clearing for multiple viewports, it used
  to clear as if there was one.
* Fix for zoom level in user defined viewports, it was based on
  the full window before, now it is based on the viewport itself.
* For user defined viewports, always use Expose instead of
  Letterbox with bars, the latter doesn't make sense then.
This commit is contained in:
Brecht Van Lommel
2008-09-14 00:32:18 +00:00
parent 06be41648f
commit 704fef314a
10 changed files with 146 additions and 96 deletions

View File

@@ -105,8 +105,12 @@ bool RAS_OpenGLRasterizer::Init()
m_ambg = 0.0f;
m_ambb = 0.0f;
SetBlendingMode(GPU_BLEND_SOLID);
SetFrontFace(true);
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
m_last_blendmode = GPU_BLEND_SOLID;
glFrontFace(GL_CCW);
m_last_frontface = true;
glClearColor(m_redback,m_greenback,m_blueback,m_alphaback);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
@@ -250,21 +254,10 @@ void RAS_OpenGLRasterizer::Exit()
EndFrame();
}
bool RAS_OpenGLRasterizer::InterlacedStereo() const
{
return m_stereomode == RAS_STEREO_VINTERLACE || m_stereomode == RAS_STEREO_INTERLACED;
}
bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time)
{
m_time = time;
m_drawingmode = drawingmode;
if (!InterlacedStereo() || m_curreye == RAS_STEREO_LEFTEYE)
{
m_2DCanvas->ClearColor(m_redback,m_greenback,m_blueback,m_alphaback);
m_2DCanvas->ClearBuffer(RAS_ICanvas::COLOR_BUFFER);
}
// Blender camera routine destroys the settings
if (m_drawingmode < KX_SOLID)
@@ -278,8 +271,12 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time)
glEnable (GL_CULL_FACE);
}
SetBlendingMode(GPU_BLEND_SOLID);
SetFrontFace(true);
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
m_last_blendmode = GPU_BLEND_SOLID;
glFrontFace(GL_CCW);
m_last_frontface = true;
glShadeModel(GL_SMOOTH);
@@ -310,6 +307,12 @@ void RAS_OpenGLRasterizer::SetDepthMask(DepthMask depthmask)
}
void RAS_OpenGLRasterizer::ClearColorBuffer()
{
m_2DCanvas->ClearColor(m_redback,m_greenback,m_blueback,m_alphaback);
m_2DCanvas->ClearBuffer(RAS_ICanvas::COLOR_BUFFER);
}
void RAS_OpenGLRasterizer::ClearDepthBuffer()
{
@@ -420,6 +423,10 @@ bool RAS_OpenGLRasterizer::Stereo()
return true;
}
bool RAS_OpenGLRasterizer::InterlacedStereo()
{
return m_stereomode == RAS_STEREO_VINTERLACE || m_stereomode == RAS_STEREO_INTERLACED;
}
void RAS_OpenGLRasterizer::SetEye(const StereoEye eye)
{

View File

@@ -88,7 +88,6 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
float m_focallength;
bool m_setfocallength;
int m_noOfScanlines;
bool InterlacedStereo() const;
//motion blur
int m_motionblur;
@@ -131,6 +130,7 @@ public:
virtual bool Init();
virtual void Exit();
virtual bool BeginFrame(int drawingmode, double time);
virtual void ClearColorBuffer();
virtual void ClearDepthBuffer();
virtual void ClearCachingInfo(void);
virtual void EndFrame();
@@ -138,6 +138,7 @@ public:
virtual void SetStereoMode(const StereoMode stereomode);
virtual bool Stereo();
virtual bool InterlacedStereo();
virtual void SetEye(const StereoEye eye);
virtual StereoEye GetEye();
virtual void SetEyeSeparation(const float eyeseparation);