mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 04:57:23 +02:00
Fix initial state of view correction, plus overkill
This commit is contained in:
parent
cbe1f6dbf5
commit
0396694715
3 changed files with 13 additions and 1 deletions
|
@ -105,6 +105,12 @@ public:
|
||||||
|
|
||||||
|
|
||||||
virtual void run() override {
|
virtual void run() override {
|
||||||
|
// FIXME determine the best priority balance between this and the main thread...
|
||||||
|
// It may be dependent on the display plugin being used, since VR plugins should
|
||||||
|
// have higher priority on rendering (although we could say that the Oculus plugin
|
||||||
|
// doesn't need that since it has async timewarp).
|
||||||
|
// A higher priority here
|
||||||
|
setPriority(QThread::HighPriority);
|
||||||
OpenGLDisplayPlugin* currentPlugin{ nullptr };
|
OpenGLDisplayPlugin* currentPlugin{ nullptr };
|
||||||
Q_ASSERT(_context);
|
Q_ASSERT(_context);
|
||||||
while (!_shutdown) {
|
while (!_shutdown) {
|
||||||
|
@ -302,6 +308,8 @@ void OpenGLDisplayPlugin::customizeContext() {
|
||||||
Q_ASSERT(thread() == presentThread->thread());
|
Q_ASSERT(thread() == presentThread->thread());
|
||||||
enableVsync();
|
enableVsync();
|
||||||
|
|
||||||
|
getGLBackend()->setCameraCorrection(mat4());
|
||||||
|
|
||||||
for (auto& cursorValue : _cursorsData) {
|
for (auto& cursorValue : _cursorsData) {
|
||||||
auto& cursorData = cursorValue.second;
|
auto& cursorData = cursorValue.second;
|
||||||
if (!cursorData.texture) {
|
if (!cursorData.texture) {
|
||||||
|
|
|
@ -118,7 +118,6 @@ void HmdDisplayPlugin::customizeContext() {
|
||||||
|
|
||||||
void HmdDisplayPlugin::uncustomizeContext() {
|
void HmdDisplayPlugin::uncustomizeContext() {
|
||||||
_overlayRenderer = OverlayRenderer();
|
_overlayRenderer = OverlayRenderer();
|
||||||
getGLBackend()->setCameraCorrection(mat4());
|
|
||||||
Parent::uncustomizeContext();
|
Parent::uncustomizeContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,11 @@ protected:
|
||||||
|
|
||||||
GLState* _state { nullptr };
|
GLState* _state { nullptr };
|
||||||
bool _invalidState { false };
|
bool _invalidState { false };
|
||||||
|
|
||||||
|
PipelineStageState() {
|
||||||
|
_cameraCorrectionBuffer.edit<CameraCorrection>() = CameraCorrection();
|
||||||
|
_cameraCorrectionBuffer._buffer->flush();
|
||||||
|
}
|
||||||
} _pipeline;
|
} _pipeline;
|
||||||
|
|
||||||
// Synchronize the state cache of this Backend with the actual real state of the GL Context
|
// Synchronize the state cache of this Backend with the actual real state of the GL Context
|
||||||
|
|
Loading…
Reference in a new issue