mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 11:42:55 +02:00
fix flash when switching display modes
This commit is contained in:
parent
477dfdff1e
commit
601b30f062
2 changed files with 13 additions and 11 deletions
|
@ -564,17 +564,19 @@ void OpenGLDisplayPlugin::updateFrameData() {
|
||||||
|
|
||||||
std::function<void(gpu::Batch&, const gpu::TexturePointer&)> OpenGLDisplayPlugin::getHUDOperator() {
|
std::function<void(gpu::Batch&, const gpu::TexturePointer&)> OpenGLDisplayPlugin::getHUDOperator() {
|
||||||
return [this](gpu::Batch& batch, const gpu::TexturePointer& hudTexture) {
|
return [this](gpu::Batch& batch, const gpu::TexturePointer& hudTexture) {
|
||||||
batch.enableStereo(false);
|
if (_hudPipeline) {
|
||||||
batch.setPipeline(_hudPipeline);
|
batch.enableStereo(false);
|
||||||
batch.setResourceTexture(0, hudTexture);
|
batch.setPipeline(_hudPipeline);
|
||||||
if (isStereo()) {
|
batch.setResourceTexture(0, hudTexture);
|
||||||
for_each_eye([&](Eye eye) {
|
if (isStereo()) {
|
||||||
batch.setViewportTransform(eyeViewport(eye, getRecommendedRenderSize()));
|
for_each_eye([&](Eye eye) {
|
||||||
|
batch.setViewportTransform(eyeViewport(eye, getRecommendedRenderSize()));
|
||||||
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
});
|
}
|
||||||
} else {
|
|
||||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,8 +431,8 @@ std::function<void(gpu::Batch&, const gpu::TexturePointer&)> HmdDisplayPlugin::H
|
||||||
updatePipeline();
|
updatePipeline();
|
||||||
return [this](gpu::Batch& batch, const gpu::TexturePointer& hudTexture) {
|
return [this](gpu::Batch& batch, const gpu::TexturePointer& hudTexture) {
|
||||||
if (pipeline) {
|
if (pipeline) {
|
||||||
|
|
||||||
batch.setPipeline(pipeline);
|
batch.setPipeline(pipeline);
|
||||||
|
|
||||||
batch.setInputFormat(format);
|
batch.setInputFormat(format);
|
||||||
gpu::BufferView posView(vertices, VERTEX_OFFSET, vertices->getSize(), VERTEX_STRIDE, format->getAttributes().at(gpu::Stream::POSITION)._element);
|
gpu::BufferView posView(vertices, VERTEX_OFFSET, vertices->getSize(), VERTEX_STRIDE, format->getAttributes().at(gpu::Stream::POSITION)._element);
|
||||||
gpu::BufferView uvView(vertices, TEXTURE_OFFSET, vertices->getSize(), VERTEX_STRIDE, format->getAttributes().at(gpu::Stream::TEXCOORD)._element);
|
gpu::BufferView uvView(vertices, TEXTURE_OFFSET, vertices->getSize(), VERTEX_STRIDE, format->getAttributes().at(gpu::Stream::TEXCOORD)._element);
|
||||||
|
|
Loading…
Reference in a new issue