@@ -110,23 +110,23 @@ static void RB_InitBuiltinPasses( void )
110110 pass -> rgbgen .type = RGB_GEN_OUTLINE ;
111111 pass -> alphagen .type = ALPHA_GEN_OUTLINE ;
112112 pass -> tcgen = TC_GEN_NONE ;
113- pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_0 ;
113+ pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_STENCIL_BACK ;
114114
115115 // overlay outline
116116 pass = & r_GLSLpasses [BUILTIN_GLSLPASS_OVERLAY_OUTLINE_1 ];
117117 pass -> flags = 0 ;
118118 pass -> rgbgen .type = RGB_GEN_OUTLINE ;
119119 pass -> alphagen .type = ALPHA_GEN_OUTLINE ;
120120 pass -> tcgen = TC_GEN_NONE ;
121- pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_1 ;
121+ pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_STENCIL_FRONT ;
122122
123123 // overlay outline
124124 pass = & r_GLSLpasses [BUILTIN_GLSLPASS_OVERLAY_OUTLINE_2 ];
125125 pass -> flags = 0 ;
126126 pass -> rgbgen .type = RGB_GEN_OUTLINE ;
127127 pass -> alphagen .type = ALPHA_GEN_OUTLINE ;
128128 pass -> tcgen = TC_GEN_NONE ;
129- pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_2 ;
129+ pass -> program_type = GLSL_PROGRAM_TYPE_OUTLINE_GHOST_FINAL ;
130130
131131
132132 // skybox
@@ -1391,10 +1391,6 @@ static void RB_RenderMeshGLSL_Shadowmap( const shaderpass_t *pass, r_glslfeat_t
13911391 RB_Scissor ( old_scissor [0 ], old_scissor [1 ], old_scissor [2 ], old_scissor [3 ] );
13921392}
13931393
1394-
1395- /*
1396- * RB_RenderMeshGLSL_Outline
1397- */
13981394static void RB_RenderMeshGLSL_StencilOutline_0 ( const shaderpass_t * pass , r_glslfeat_t programFeatures )
13991395{
14001396 Vector4Copy ( rb .currentEntity -> outlineColorGhost , rb .entityOutlineColor );
@@ -1425,7 +1421,7 @@ static void RB_RenderMeshGLSL_StencilOutline_0( const shaderpass_t *pass, r_glsl
14251421 RB_SetStencilOp ( GL_REPLACE , GL_ZERO , GL_REPLACE );
14261422 RB_SetStencilFunc ( GL_ALWAYS , 1 , 0xFF );
14271423
1428- RB_SetShaderpassState ( pass -> flags | GLSTATE_STENCIL_TEST | GLSTATE_DEPTHFUNC_GT );// | GLSTATE_NO_COLORWRITE ) ;
1424+ RB_SetShaderpassState ( pass -> flags | GLSTATE_STENCIL_TEST | GLSTATE_DEPTHFUNC_GT );;
14291425 RP_UpdateOutlineUniforms ( program , rb .currentEntity -> outlineGhost );
14301426 RB_DrawElementsReal ( & rb .drawElements );
14311427}
@@ -2024,13 +2020,13 @@ void RB_RenderMeshGLSLProgrammed( const shaderpass_t *pass, int programType )
20242020 case GLSL_PROGRAM_TYPE_SHADOWMAP :
20252021 RB_RenderMeshGLSL_Shadowmap ( pass , features );
20262022 break ;
2027- case GLSL_PROGRAM_TYPE_OUTLINE_0 :
2023+ case GLSL_PROGRAM_TYPE_OUTLINE_STENCIL_BACK :
20282024 RB_RenderMeshGLSL_StencilOutline_0 (pass , features );
20292025 break ;
2030- case GLSL_PROGRAM_TYPE_OUTLINE_1 :
2026+ case GLSL_PROGRAM_TYPE_OUTLINE_STENCIL_FRONT :
20312027 RB_RenderMeshGLSL_StencilOutline_1 (pass , features );
20322028 break ;
2033- case GLSL_PROGRAM_TYPE_OUTLINE_2 :
2029+ case GLSL_PROGRAM_TYPE_OUTLINE_GHOST_FINAL :
20342030 RB_RenderMeshGLSL_StencilOutline_2 (pass , features );
20352031 break ;
20362032 case GLSL_PROGRAM_TYPE_OUTLINE :
@@ -2543,7 +2539,7 @@ void RB_DrawShadedElements( void )
25432539 if ( addGLSLOutline )
25442540 RB_RenderPass ( & r_GLSLpasses [BUILTIN_GLSLPASS_OUTLINE ] );
25452541
2546- if (rb .currentEntity -> outlineGhost )
2542+ if (rb .currentEntity -> outlineGhost && glConfig . stencilBits )
25472543 RB_RenderPass ( & r_GLSLpasses [BUILTIN_GLSLPASS_OVERLAY_OUTLINE_2 ] );
25482544
25492545 // fog
0 commit comments