mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 13:10:42 +02:00
Fixed broken TAA on desktop... grrr.
This commit is contained in:
parent
4636f43728
commit
d316b6e074
4 changed files with 11 additions and 4 deletions
|
@ -692,6 +692,9 @@ void OpenGLDisplayPlugin::present() {
|
|||
incrementPresentCount();
|
||||
|
||||
if (_currentFrame) {
|
||||
auto correction = getViewCorrection();
|
||||
getGLBackend()->setCameraCorrection(correction, _prevRenderView);
|
||||
_prevRenderView = correction * _currentFrame->view;
|
||||
{
|
||||
withPresentThreadLock([&] {
|
||||
_renderRate.increment();
|
||||
|
|
|
@ -118,6 +118,7 @@ protected:
|
|||
void renderFromTexture(gpu::Batch& batch, const gpu::TexturePointer texture, glm::ivec4 viewport, const glm::ivec4 scissor, gpu::FramebufferPointer fbo);
|
||||
void renderFromTexture(gpu::Batch& batch, const gpu::TexturePointer texture, glm::ivec4 viewport, const glm::ivec4 scissor);
|
||||
virtual void updateFrameData();
|
||||
virtual glm::mat4 getViewCorrection() { return glm::mat4(); }
|
||||
|
||||
void withOtherThreadContext(std::function<void()> f) const;
|
||||
|
||||
|
@ -137,6 +138,7 @@ protected:
|
|||
|
||||
gpu::FramePointer _currentFrame;
|
||||
gpu::Frame* _lastFrame { nullptr };
|
||||
mat4 _prevRenderView;
|
||||
gpu::FramebufferPointer _compositeFramebuffer;
|
||||
gpu::PipelinePointer _hudPipeline;
|
||||
gpu::PipelinePointer _mirrorHUDPipeline;
|
||||
|
|
|
@ -336,12 +336,14 @@ void HmdDisplayPlugin::updateFrameData() {
|
|||
}
|
||||
|
||||
updatePresentPose();
|
||||
}
|
||||
|
||||
glm::mat4 HmdDisplayPlugin::getViewCorrection() {
|
||||
if (_currentFrame) {
|
||||
auto batchPose = _currentFrame->pose;
|
||||
auto correction = glm::inverse(_currentPresentFrameInfo.presentPose) * batchPose ;
|
||||
getGLBackend()->setCameraCorrection(correction, _prevRenderView);
|
||||
_prevRenderView = correction * _currentFrame->view;
|
||||
return glm::inverse(_currentPresentFrameInfo.presentPose) * batchPose;
|
||||
} else {
|
||||
return glm::mat4();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ protected:
|
|||
void customizeContext() override;
|
||||
void uncustomizeContext() override;
|
||||
void updateFrameData() override;
|
||||
glm::mat4 getViewCorrection() override;
|
||||
|
||||
std::array<mat4, 2> _eyeOffsets;
|
||||
std::array<mat4, 2> _eyeProjections;
|
||||
|
@ -79,7 +80,6 @@ protected:
|
|||
QMap<uint32_t, FrameInfo> _frameInfos;
|
||||
FrameInfo _currentPresentFrameInfo;
|
||||
FrameInfo _currentRenderFrameInfo;
|
||||
mat4 _prevRenderView;
|
||||
RateCounter<> _stutterRate;
|
||||
|
||||
bool _disablePreview { true };
|
||||
|
|
Loading…
Reference in a new issue