mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 02:48:25 -05:00
Merging Master
This commit is contained in:
@@ -106,15 +106,15 @@ void ScreenSpaceFramebuffer::render() {
|
||||
const glm::vec2& resolution = global::windowDelegate.currentWindowResolution();
|
||||
const glm::vec4& size = _size.value();
|
||||
|
||||
const float xratio = _originalViewportSize.x / (size.z - size.x);
|
||||
const float yratio = _originalViewportSize.y / (size.w - size.y);;
|
||||
const float xratio = resolution.x / (size.z - size.x);
|
||||
const float yratio = resolution.y / (size.w - size.y);;
|
||||
|
||||
if (!_renderFunctions.empty()) {
|
||||
glViewport(
|
||||
static_cast<GLint>(-size.x * xratio),
|
||||
static_cast<GLint>(-size.y * yratio),
|
||||
static_cast<GLsizei>(_originalViewportSize.x * xratio),
|
||||
static_cast<GLsizei>(_originalViewportSize.y * yratio)
|
||||
static_cast<GLsizei>(resolution.x * xratio),
|
||||
static_cast<GLsizei>(resolution.y * yratio)
|
||||
);
|
||||
GLint defaultFBO = _framebuffer->getActiveObject();
|
||||
_framebuffer->activate();
|
||||
@@ -170,14 +170,16 @@ void ScreenSpaceFramebuffer::removeAllRenderFunctions() {
|
||||
}
|
||||
|
||||
void ScreenSpaceFramebuffer::createFramebuffer() {
|
||||
glm::vec2 resolution = global::windowDelegate.currentWindowResolution();
|
||||
|
||||
_framebuffer = std::make_unique<ghoul::opengl::FramebufferObject>();
|
||||
_framebuffer->activate();
|
||||
_texture = std::make_unique<ghoul::opengl::Texture>(glm::uvec3(
|
||||
_originalViewportSize.x,
|
||||
_originalViewportSize.y,
|
||||
resolution.x,
|
||||
resolution.y,
|
||||
1
|
||||
));
|
||||
_objectSize = glm::ivec2(_originalViewportSize);
|
||||
_objectSize = glm::ivec2(resolution);
|
||||
|
||||
_texture->uploadTexture();
|
||||
_texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
|
||||
|
||||
Reference in New Issue
Block a user