Merging Master

This commit is contained in:
Jonathas Costa
2019-07-22 16:47:58 -04:00
parent 20d24764e7
commit a6b90991b2
119 changed files with 1812 additions and 1660 deletions
@@ -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);