Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-02-01 18:13:05 +0300
committerDalai Felinto <dfelinto@gmail.com>2010-02-01 18:13:05 +0300
commit90e2b22feeb142d190b7aa2dd1e98fdd48f572bc (patch)
tree2cc26d41d26f5e0da88d29ff9e40c45879191e55 /source/gameengine
parent7bd3d1213a2983a544adf8e1805d043f1bb10a32 (diff)
BGE: fix for [#20684] Game Render blanks screen on Anaglyph Stereo view
The problem was: the Blender default camera has DOF distance as 0.0. Since we are using this as Focal Length for the stereo calculation we had terrible stereo by default. Fix: whenever DOF == 0.0 we use focal length as eye separation * 30.0 (known to be a reasonable value)
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index bbccb511249..67b5c89efbf 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -904,7 +904,9 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
// if Rasterizer.setFocalLength is not called we use the camera focallength
if (!m_setfocallength)
- m_focallength = focallength;
+ // if focallength is null we use a value known to be reasonable
+ m_focallength = (focallength == 0.f) ? m_eyeseparation * 30.0
+ : focallength;
near_div_focallength = frustnear / m_focallength;
offset = 0.5 * m_eyeseparation * near_div_focallength;