disable sun/moon rendering on ATI cards in legacy renderer, prone to crashes

This commit is contained in:
milek7
2023-05-26 17:14:34 +02:00
parent 0ba7a318aa
commit eaaecd36cc
2 changed files with 5 additions and 0 deletions

View File

@@ -1572,6 +1572,7 @@ opengl_renderer::Render( world_environment *Environment ) {
glm::vec3( 235.0f / 255.0f, 140.0f / 255.0f, 36.0f / 255.0f ),
duskfactor );
// sun
if (!m_isATI)
{
Bind_Texture( m_suntexture );
::glColor4f( suncolor.x, suncolor.y, suncolor.z, clamp( 1.5f - Global.Overcast, 0.f, 1.f ) * fogfactor );
@@ -1596,6 +1597,7 @@ opengl_renderer::Render( world_environment *Environment ) {
::glPopMatrix();
}
// moon
if (!m_isATI)
{
Bind_Texture( m_moontexture );
glm::vec3 mooncolor( 255.0f / 255.0f, 242.0f / 255.0f, 231.0f / 255.0f );
@@ -4397,6 +4399,8 @@ opengl_renderer::Init_caps() {
return false;
}
m_isATI = (gl_vendor.find("ATI") != -1);
char* extensions = (char*)glGetString( GL_EXTENSIONS );
if (extensions)
WriteLog( "Supported extensions: \n" + std::string(extensions));

View File

@@ -366,6 +366,7 @@ private:
#ifdef EU07_USE_DEBUG_CAMERA
renderpass_config m_worldcamera; // debug item
#endif
bool m_isATI;
static bool renderer_register;
};