mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 12:39:24 -05:00
Don't keep the majority of textures in RAM if they are not needed, further reducing the memory footprint
This commit is contained in:
@@ -453,6 +453,7 @@ void RenderableModel::loadTexture() {
|
||||
);
|
||||
_texture->uploadTexture();
|
||||
_texture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
|
||||
_texture->purgeFromRAM();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,6 +488,7 @@ void RenderableSphere::loadTexture() {
|
||||
);
|
||||
texture->uploadTexture();
|
||||
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
texture->purgeFromRAM();
|
||||
_texture = std::move(texture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ void ScreenSpaceFramebuffer::createFramebuffer() {
|
||||
|
||||
_texture->uploadTexture();
|
||||
_texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
_texture->purgeFromRAM();
|
||||
_framebuffer->attachTexture(_texture.get(), GL_COLOR_ATTACHMENT0);
|
||||
_framebuffer->deactivate();
|
||||
}
|
||||
|
||||
@@ -132,10 +132,8 @@ void ScreenSpaceImageLocal::update() {
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
texture->uploadTexture();
|
||||
|
||||
// Textures of planets looks much smoother with AnisotropicMipMap rather than
|
||||
// linear
|
||||
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
texture->purgeFromRAM();
|
||||
|
||||
_texture = std::move(texture);
|
||||
_objectSize = _texture->dimensions();
|
||||
|
||||
@@ -142,10 +142,8 @@ void ScreenSpaceImageOnline::update() {
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
texture->uploadTexture();
|
||||
|
||||
// Textures of planets looks much smoother with AnisotropicMipMap rather
|
||||
// than linear
|
||||
texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
texture->purgeFromRAM();
|
||||
|
||||
_texture = std::move(texture);
|
||||
_objectSize = _texture->dimensions();
|
||||
|
||||
Reference in New Issue
Block a user