History

Attempting to fix 3DTV/Oculus deferred lighting/ambient occlusion.

Andrzej Kapolka committed 12 years ago

Commit 2cba7b31 parent c5ad6035 files · +48 −1Browse files

Showing the changes to interface/src/devices/OculusManager.cpp (1 of 5 files). Show all

Unified · Split

interface/src/devices/OculusManager.cpp+17−0
@@ -53,6 +53,7 @@ unsigned int OculusManager::_frameIndex = 0; · 52 unmodified lines
53bool OculusManager::_frameTimingActive = false;53bool OculusManager::_frameTimingActive = false;
54bool OculusManager::_programInitialized = false;54bool OculusManager::_programInitialized = false;
55Camera* OculusManager::_camera = NULL;55Camera* OculusManager::_camera = NULL;
56int OculusManager::_activeEyeIndex = -1;
56 57
57#endif58#endif
58 59
@@ -330,6 +331,8 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p · 271 unmodified lines
330 331
331 //Render each eye into an fbo332 //Render each eye into an fbo
332 for (int eyeIndex = 0; eyeIndex < ovrEye_Count; eyeIndex++) {333 for (int eyeIndex = 0; eyeIndex < ovrEye_Count; eyeIndex++) {
334 _activeEyeIndex = eyeIndex;
335
333#if defined(__APPLE__) || defined(_WIN32)336#if defined(__APPLE__) || defined(_WIN32)
334 ovrEyeType eye = _ovrHmd->EyeRenderOrder[eyeIndex];337 ovrEyeType eye = _ovrHmd->EyeRenderOrder[eyeIndex];
335#else338#else
@@ -363,6 +366,7 @@ void OculusManager::display(const glm::quat &bodyOrientation, const glm::vec3 &p · 27 unmodified lines
363 Application::getInstance()->displaySide(*_camera);366 Application::getInstance()->displaySide(*_camera);
364 367
365 applicationOverlay.displayOverlayTextureOculus(*_camera);368 applicationOverlay.displayOverlayTextureOculus(*_camera);
369 _activeEyeIndex = -1;
366 }370 }
367 371
368 //Wait till time-warp to reduce latency372 //Wait till time-warp to reduce latency
@@ -528,3 +532,16 @@ QSize OculusManager::getRenderTargetSize() { · 159 unmodified lines
528 return QSize(100, 100);532 return QSize(100, 100);
529#endif533#endif
530}534}
535
536void OculusManager::overrideOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& nearVal,
537 float& farVal, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) {
538#ifdef HAVE_LIBOVR
539 if (_activeEyeIndex != -1) {
540 float extent = nearVal * glm::tan(_eyeRenderDesc[_activeEyeIndex].Fov / 2.0f);
541 right = extent;
542 left = -extent;
543 top = extent;
544 bottom = -extent;
545 }
546#endif
547}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t