MYST3: Improve the node transition performance
On 4K displays, taking a screenshot and processing the pixels on the CPU was taking a noticeable amount of time. Now the screenshot is copied directly to a texture without going through the CPU.
This commit is contained in:
parent
93929be2c1
commit
056912f4b2
11 changed files with 99 additions and 27 deletions
|
@ -249,6 +249,7 @@ void ShaderRenderer::drawTexturedRect2D(const Common::Rect &screenRect, const Co
|
|||
_boxShader->setUniform("verSizeWH", scaled(sWidth, sHeight));
|
||||
_boxShader->setUniform("texOffsetXY", Math::Vector2d(tLeft, tTop));
|
||||
_boxShader->setUniform("texSizeWH", Math::Vector2d(tWidth, tHeight));
|
||||
_boxShader->setUniform("flipY", glTexture->upsideDown);
|
||||
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
|
@ -398,6 +399,15 @@ Graphics::Surface *ShaderRenderer::getScreenshot() {
|
|||
return s;
|
||||
}
|
||||
|
||||
Texture *ShaderRenderer::copyScreenshotToTexture() {
|
||||
OpenGLTexture *texture = new OpenGLTexture();
|
||||
|
||||
Common::Rect screen = viewport();
|
||||
texture->copyFromFramebuffer(screen);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
} // End of namespace Myst3
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue