@@ -1379,7 +1379,7 @@ static void RB_RenderMeshGLSL_Shadowmap( const shaderpass_t *pass, r_glslfeat_t
13791379*/
13801380static void RB_RenderMeshGLSL_OverlayOutline ( const shaderpass_t * pass , r_glslfeat_t programFeatures )
13811381{
1382- // int faceCull = rb.gl.faceCull;
1382+ int faceCull = rb .gl .faceCull ;
13831383 mat4_t texMatrix ;
13841384
13851385 if ( rb .currentModelType == mod_brush ) {
@@ -1401,7 +1401,6 @@ static void RB_RenderMeshGLSL_OverlayOutline( const shaderpass_t *pass, r_glslfe
14011401
14021402 Matrix4_Identity ( texMatrix );
14031403
1404- //RB_Cull( GL_BACK );
14051404
14061405 RB_UpdateCommonUniforms ( program , pass , texMatrix );
14071406
@@ -1422,25 +1421,27 @@ static void RB_RenderMeshGLSL_OverlayOutline( const shaderpass_t *pass, r_glslfe
14221421 RB_SetShaderpassState ( pass -> flags | GLSTATE_STENCIL_TEST | GLSTATE_DEPTHFUNC_GT | GLSTATE_NO_COLORWRITE );
14231422 RP_UpdateOutlineUniforms ( program , 2.0f );
14241423 RB_DrawElementsReal ( & rb .drawElements );
1424+
1425+ RB_SetStencilFunc ( GL_ALWAYS , 0x0 , 0xFF );
1426+ RB_SetStencilOp ( GL_REPLACE , GL_REPLACE , GL_REPLACE );
14251427
1426- RB_SetStencilFunc ( GL_ALWAYS , 0x0 , 0xFF );
1427- RB_SetStencilOp ( GL_REPLACE , GL_REPLACE , GL_REPLACE );
1428+ RB_SetShaderpassState ( pass -> flags | GLSTATE_STENCIL_TEST | GLSTATE_NO_DEPTH_TEST | GLSTATE_NO_COLORWRITE );
1429+ RP_UpdateOutlineUniforms ( program , 0 );
1430+ RB_DrawElementsReal ( & rb .drawElements );
14281431
1429- RB_SetShaderpassState ( pass -> flags | GLSTATE_STENCIL_TEST | GLSTATE_NO_DEPTH_TEST | GLSTATE_NO_COLORWRITE );
1430- RP_UpdateOutlineUniforms ( program , 0 );
1431- RB_DrawElementsReal ( & rb .drawElements );
1432+ RB_Cull ( GL_BACK );
14321433
1433- RB_SetStencilOp ( GL_KEEP , GL_KEEP , GL_KEEP );
1434- RB_SetStencilFunc ( GL_EQUAL , 1 , 0xFF );
1435- RB_SetStencilMask ( 0x00 );
1434+ RB_SetStencilOp ( GL_ZERO , GL_ZERO , GL_ZERO );
1435+ RB_SetStencilFunc ( GL_EQUAL , 1 , 0xFF );
1436+ RB_SetStencilMask ( 0xFF );
14361437
1437- RB_SetShaderpassState ( pass -> flags | GLSTATE_NO_DEPTH_TEST | GLSTATE_STENCIL_TEST );
1438- RP_UpdateOutlineUniforms ( program , 2.0f );
1439- RB_DrawElementsReal ( & rb .drawElements );
1438+ RB_SetShaderpassState ( pass -> flags | GLSTATE_DEPTHFUNC_GT | GLSTATE_STENCIL_TEST );
1439+ RP_UpdateOutlineUniforms ( program , rb . currentEntity -> outlineHeight * r_outlines_scale -> value );
1440+ RB_DrawElementsReal ( & rb .drawElements );
14401441
1441- RB_SetShaderpassState ( pass -> flags );
1442+ // RB_SetShaderpassState( pass->flags );
14421443
1443- // RB_Cull( faceCull );
1444+ RB_Cull ( faceCull );
14441445}
14451446
14461447/*
@@ -1472,7 +1473,7 @@ static void RB_RenderMeshGLSL_Outline( const shaderpass_t *pass, r_glslfeat_t pr
14721473 RB_Cull ( GL_BACK );
14731474
14741475 // set shaderpass state (blending, depthwrite, etc)
1475- RB_SetShaderpassState ( pass -> flags );
1476+ RB_SetShaderpassState ( pass -> flags );
14761477
14771478 RB_UpdateCommonUniforms ( program , pass , texMatrix );
14781479
@@ -1486,6 +1487,10 @@ static void RB_RenderMeshGLSL_Outline( const shaderpass_t *pass, r_glslfeat_t pr
14861487 if ( programFeatures & GLSL_SHADER_COMMON_BONE_TRANSFORMS ) {
14871488 RP_UpdateBonesUniforms ( program , rb .bonesData .numBones , rb .bonesData .dualQuats );
14881489 }
1490+
1491+ //RB_SetStencilMask( 0xFF );
1492+ //RB_SetStencilOp( GL_ZERO, GL_REPLACE, GL_REPLACE);
1493+ //RB_SetStencilFunc( GL_ALWAYS, 1, 0xFF );
14891494
14901495 RB_DrawElementsReal ( & rb .drawElements );
14911496
0 commit comments