History

Using proper inverse projection matrix in velocity buffer computation to reproject to world pos

Olivier Prat committed 8 years ago

Commit b7b478f1 parent 5af43379 files · +29 −11Browse files

Showing the changes to libraries/render-utils/src/DeferredFrameTransform.cpp (1 of 9 files). Show all

Unified · Split

libraries/render-utils/src/DeferredFrameTransform.cpp+2−0
@@ -48,6 +48,7 @@ void DeferredFrameTransform::update(RenderArgs* args) { · 47 unmodified lines
4848 frameTransformBuffer.projection[0] = frameTransformBuffer.projectionMono;
4949 frameTransformBuffer.stereoInfo = glm::vec4(0.0f, (float)args->_viewport.z, 0.0f, 0.0f);
5050 frameTransformBuffer.invpixelInfo = glm::vec4(1.0f / args->_viewport.z, 1.0f / args->_viewport.w, 0.0f, 0.0f);
51+ frameTransformBuffer.invProjection[0] = glm::inverse(frameTransformBuffer.projection[0]);
5152 } else {
5253
5354 mat4 projMats[2];
@@ -59,6 +60,7 @@ void DeferredFrameTransform::update(RenderArgs* args) { · 5 unmodified lines
5960 // Compose the mono Eye space to Stereo clip space Projection Matrix
6061 auto sideViewMat = projMats[i] * eyeViews[i];
6162 frameTransformBuffer.projection[i] = sideViewMat;
63+ frameTransformBuffer.invProjection[i] = glm::inverse(sideViewMat);
6264 }
6365
6466 frameTransformBuffer.stereoInfo = glm::vec4(1.0f, (float)(args->_viewport.z >> 1), 0.0f, 1.0f);

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