mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 02:32:18 +00:00
Fixed Crash with ImGui when changing the resolution
This commit is contained in:
parent
93710bd694
commit
f92c3776ff
3 changed files with 17 additions and 6 deletions
|
@ -143,10 +143,10 @@ void main( PS_IN fragment, out PS_OUT result )
|
|||
|
||||
#endif
|
||||
|
||||
float3 diffuseLight = ( texCUBE( samp7, globalNormal ).rgb ) * diffuseColor * ( rpDiffuseModifier.xyz ) * 3.5f;
|
||||
float3 diffuseLight = ( texCUBE( samp7, globalNormal ).rgb ) * diffuseColor * ( rpDiffuseModifier.xyz ) * 3.5;
|
||||
|
||||
float mip = clamp( ( roughness * 7.0 ) + 3.0, 0.0, 10.0 );
|
||||
float3 envColor = ( textureLod( samp8, reflectionVector, mip ).rgb ) * ( rpSpecularModifier.xyz ) * 1.0f;
|
||||
float mip = clamp( ( roughness * 7.0 ) + 0.0, 0.0, 10.0 );
|
||||
float3 envColor = ( textureLod( samp8, reflectionVector, mip ).rgb ) * ( rpSpecularModifier.xyz ) * 0.5;
|
||||
|
||||
float3 specularLight = envColor * specularColor;
|
||||
|
||||
|
|
|
@ -282,6 +282,16 @@ void NotifyDisplaySizeChanged( int width, int height )
|
|||
{
|
||||
Destroy();
|
||||
Init( width, height );
|
||||
|
||||
// reuse the default ImGui font
|
||||
idImage* image = globalImages->GetImage( "_imguiFont" );
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
byte* pixels = NULL;
|
||||
io.Fonts->GetTexDataAsRGBA32( &pixels, &width, &height );
|
||||
|
||||
io.Fonts->TexID = ( void* )( intptr_t )image->GetImGuiTextureID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -437,6 +447,7 @@ void Destroy()
|
|||
{
|
||||
ImGui::DestroyContext();
|
||||
g_IsInit = false;
|
||||
g_haveNewFrame = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2337,10 +2337,10 @@ static const cgShaderDef_t cg_renderprogs[] =
|
|||
"\n"
|
||||
"#endif\n"
|
||||
" \n"
|
||||
" float3 diffuseLight = ( texCUBE( samp7, globalNormal ).rgb ) * diffuseColor * ( rpDiffuseModifier.xyz ) * 3.5f;\n"
|
||||
" float3 diffuseLight = ( texCUBE( samp7, globalNormal ).rgb ) * diffuseColor * ( rpDiffuseModifier.xyz ) * 3.5;\n"
|
||||
" \n"
|
||||
" float mip = clamp( ( roughness * 7.0 ) + 3.0, 0.0, 10.0 );\n"
|
||||
" float3 envColor = ( textureLod( samp8, reflectionVector, mip ).rgb ) * ( rpSpecularModifier.xyz ) * 1.0f;\n"
|
||||
" float mip = clamp( ( roughness * 7.0 ) + 0.0, 0.0, 10.0 );\n"
|
||||
" float3 envColor = ( textureLod( samp8, reflectionVector, mip ).rgb ) * ( rpSpecularModifier.xyz ) * 0.5;\n"
|
||||
" \n"
|
||||
" float3 specularLight = envColor * specularColor;\n"
|
||||
" \n"
|
||||
|
|
Loading…
Reference in a new issue