Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: third_party/WebKit/Source/modules/vr/VRFrameData.cpp

Issue 2407413002: Fixed depth range of WebVR projection matrices (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRFrameData.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRFrameData.cpp b/third_party/WebKit/Source/modules/vr/VRFrameData.cpp
index a899fc7509e93260df810a6730652d4267247172..879c25f3739072d9fc5607af4a7a842514334d70 100644
--- a/third_party/WebKit/Source/modules/vr/VRFrameData.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRFrameData.cpp
@@ -38,11 +38,11 @@ void projectionFromFieldOfView(DOMFloat32Array* outArray,
out[7] = 0.0f;
out[8] = -((leftTan - rightTan) * xScale * 0.5);
out[9] = ((upTan - downTan) * yScale * 0.5);
- out[10] = depthFar / (depthNear - depthFar);
+ out[10] = (depthNear + depthFar) / (depthNear - depthFar);
out[11] = -1.0f;
out[12] = 0.0f;
out[13] = 0.0f;
- out[14] = (depthFar * depthNear) / (depthNear - depthFar);
+ out[14] = (2 * depthFar * depthNear) / (depthNear - depthFar);
out[15] = 0.0f;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698