Reenabling multisampling.
This commit is contained in:
parent
4a7c552508
commit
5599a39eff
11
graphics.cc
11
graphics.cc
@ -41,7 +41,7 @@ void Graphics::init(Level* level) {
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
|
||||
//glEnable(GL_MULTISAMPLE);
|
||||
glEnable(GL_MULTISAMPLE);
|
||||
|
||||
|
||||
// update lights on creation
|
||||
@ -288,7 +288,7 @@ void Graphics::render(double time)
|
||||
}
|
||||
|
||||
// lighting render pass
|
||||
framebuffer_light->bind();
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
//wind
|
||||
@ -360,6 +360,13 @@ void Graphics::render(double time)
|
||||
}
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
framebuffer_light->bind();
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer_light->getObjectName());
|
||||
glBlitFramebuffer(0, 0, windowSize.x, windowSize.y, 0, 0, windowSize.x, windowSize.y,
|
||||
GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
|
||||
|
||||
// draw slightly larger only for stencil buffer to blur edges
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_ALWAYS, 1, 0xFF); //Set any stencil to 1
|
||||
|
2
main.cc
2
main.cc
@ -87,7 +87,7 @@ bool createWindow()
|
||||
setGLFWHintsForOpenGLVersion( ACGL_OPENGL_VERSION );
|
||||
|
||||
// activate multisampling (second parameter is the number of samples):
|
||||
//glfwWindowHint( GLFW_SAMPLES, 4);
|
||||
glfwWindowHint( GLFW_SAMPLES, 4);
|
||||
|
||||
// request an OpenGL debug context:
|
||||
glfwWindowHint( GLFW_OPENGL_DEBUG_CONTEXT, true );
|
||||
|
Loading…
Reference in New Issue
Block a user