Commit f69a186b authored by Michele Bosi's avatar Michele Bosi

Vivid: full support to scissor test

parent f68d1d23
......@@ -417,6 +417,10 @@ void VividRenderer::renderStencil(Camera* camera) {
//-------------------------------------------------------------------------------------------------
void VividRenderer::renderFrontToBackPeeling(const RenderQueue* render_queue, Camera* camera, real frame_clock)
{
// ---------------------------------------------------------------------
// 0. Initialize Renderwise Uniforms
// ---------------------------------------------------------------------
mShaderOutline2D->gocUniform("vl_Vivid.opacity")->setUniform( mVividRendering->opacity() );
//mShaderOutline3D->gocUniform("vl_Vivid.outline.eyeOffset")->setUniform( mVividRendering->outline3DEyeOffset() );
......@@ -708,10 +712,17 @@ void VividRenderer::render2DOutlines(const RenderQueue* render_queue, Camera* ca
// use default program, no alpha
glDisable( GL_BLEND );
glUseProgram( 0 );
// clear color: pure `black`
// white: outside the scissor so we don't get the `capping` effect
if( glIsEnabled( GL_SCISSOR_TEST ) ) {
glDisable( GL_SCISSOR_TEST );
glClearColor( 1, 1, 1, 1 );
glClear( GL_COLOR_BUFFER_BIT );
glEnable( GL_SCISSOR_TEST );
}
// black: inside the scissor
glClearColor( 0, 0, 0, 0 );
glClear( GL_COLOR_BUFFER_BIT );
// render geometry: pure `white`
// white: render geometry
glColor4f( 1, 1, 1, 1 );
tok->mRenderable->render( actor, shader, camera, opengl_context );
// bind previous framebuffer
......@@ -972,7 +983,7 @@ const RenderQueue* VividRenderer::render(const RenderQueue* render_queue, Camera
projViewTransfCallback()->updateMatrices( /*update_cm*/true, /*update_tr*/false, NULL, camera, /*cur_transform*/NULL );
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_SCISSOR_TEST);
// glDisable(GL_SCISSOR_TEST);
glDepthMask(GL_TRUE);
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
......@@ -1001,7 +1012,7 @@ const RenderQueue* VividRenderer::render(const RenderQueue* render_queue, Camera
glDisable(GL_POINT_SMOOTH);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_SCISSOR_TEST);
// glDisable(GL_SCISSOR_TEST);
glDepthMask(GL_TRUE);
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
......@@ -1012,7 +1023,7 @@ const RenderQueue* VividRenderer::render(const RenderQueue* render_queue, Camera
glDisable(GL_FOG);
// clear enables
// opengl_context->applyEnables( mDummyEnables.get() ); VL_CHECK_OGL();
opengl_context->applyEnables( mDummyEnables.get() ); VL_CHECK_OGL();
// clear render states
opengl_context->applyRenderStates( mDummyStateSet.get(), NULL ); VL_CHECK_OGL();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment