Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/GameSetup.cpp +++ ps/trunk/source/ps/GameSetup/GameSetup.cpp @@ -934,9 +934,10 @@ // (must come after SetVideoMode, since it calls ogl_Init) CStr8 renderPath = "default"; CFG_GET_VAL("renderpath", renderPath); - if ((ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", NULL) != 0 // ARB - && ogl_HaveExtensions(0, "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", NULL) != 0) // GLSL + if ((ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", nullptr) // ARB + && ogl_HaveExtensions(0, "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", nullptr)) // GLSL || !ogl_HaveExtension("GL_ARB_vertex_buffer_object") // VBO + || ogl_HaveExtensions(0, "GL_ARB_multitexture", "GL_EXT_draw_range_elements", nullptr) || (!ogl_HaveExtension("GL_EXT_framebuffer_object") && !ogl_HaveExtension("GL_ARB_framebuffer_object")) || RenderPathEnum::FromString(renderPath) == FIXED) { @@ -950,34 +951,6 @@ ); } - const char* missing = ogl_HaveExtensions(0, - "GL_ARB_multitexture", - "GL_EXT_draw_range_elements", - "GL_ARB_texture_env_combine", - "GL_ARB_texture_env_dot3", - NULL); - if(missing) - { - wchar_t buf[500]; - swprintf_s(buf, ARRAY_SIZE(buf), - L"The %hs extension doesn't appear to be available on your computer." - L" The game may still work, though - you are welcome to try at your own risk." - L" If not or it doesn't look right, upgrade your graphics card.", - missing - ); - DEBUG_DISPLAY_ERROR(buf); - // TODO: i18n - } - - if (!ogl_HaveExtension("GL_ARB_texture_env_crossbar")) - { - DEBUG_DISPLAY_ERROR( - L"The GL_ARB_texture_env_crossbar extension doesn't appear to be available on your computer." - L" Shadows are not available and overall graphics quality might suffer." - L" You are advised to try installing newer drivers and/or upgrade your graphics card."); - g_ConfigDB.SetValueBool(CFG_HWDETECT, "shadows", false); - } - ogl_WarnIfError(); g_RenderingOptions.ReadConfigAndSetupHooks(); Index: ps/trunk/source/renderer/Renderer.cpp =================================================================== --- ps/trunk/source/renderer/Renderer.cpp +++ ps/trunk/source/renderer/Renderer.cpp @@ -1132,13 +1132,6 @@ // inverted depth test so any behind an occluder will get drawn in a constant // color. - float silhouetteAlpha = 0.75f; - - // Silhouette blending requires an almost-universally-supported extension; - // fall back to non-blended if unavailable - if (!ogl_HaveExtension("GL_EXT_blend_color")) - silhouetteAlpha = 1.f; - glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glColorMask(0, 0, 0, 0); @@ -1169,27 +1162,16 @@ glDepthFunc(GL_GEQUAL); glColorMask(1, 1, 1, 1); - // Render more efficiently if alpha == 1 - if (silhouetteAlpha == 1.f) - { - // Ideally we'd render objects back-to-front so nearer silhouettes would - // appear on top, but sorting has non-zero cost. So we'll keep the depth - // write enabled, to do the opposite - far objects will consistently appear - // on top. - glDepthMask(0); - } - else - { - // Since we can't sort, we'll use the stencil buffer to ensure we only draw - // a pixel once (using the color of whatever model happens to be drawn first). - glEnable(GL_BLEND); - glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); - pglBlendColorEXT(0, 0, 0, silhouetteAlpha); - - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_NOTEQUAL, 1, (GLuint)-1); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - } + // Since we can't sort, we'll use the stencil buffer to ensure we only draw + // a pixel once (using the color of whatever model happens to be drawn first). + glEnable(GL_BLEND); + glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); + const float silhouetteAlpha = 0.75f; + pglBlendColorEXT(0, 0, 0, silhouetteAlpha); + + glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_NOTEQUAL, 1, (GLuint)-1); + glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); { PROFILE("render model casters"); @@ -1203,17 +1185,10 @@ // Restore state glDepthFunc(GL_LEQUAL); - if (silhouetteAlpha == 1.f) - { - glDepthMask(1); - } - else - { - glDisable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - pglBlendColorEXT(0, 0, 0, 0); - glDisable(GL_STENCIL_TEST); - } + glDisable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + pglBlendColorEXT(0, 0, 0, 0); + glDisable(GL_STENCIL_TEST); } void CRenderer::RenderParticles(int cullGroup)