Merge pull request #28 from MaSzyna-EU07/fix-experimental

Fix experimental
This commit is contained in:
2025-10-29 22:49:02 +01:00
committed by GitHub
2 changed files with 13 additions and 4 deletions

View File

@@ -92,8 +92,12 @@ bool NvRenderer::Init(GLFWwindow *Window) {
m_fsr = std::make_shared<NvFSR>(this);
m_bloom = std::make_shared<Bloom>(GetBackend());
m_gbuffer->Init(Global.gfx_framebuffer_width, Global.gfx_framebuffer_height,
false, false, false);
// protect from undefined framebuffer size in ini (default -1)
int w = Global.gfx_framebuffer_width, h = Global.gfx_framebuffer_height;
if (w < 0) w = Global.window_size.x;
if (h < 0) h = Global.window_size.y;
m_gbuffer->Init(w, h, false, false, false);
m_contact_shadows->Init();
m_shadow_map->Init();
m_gbuffer_cube->Init(512, 512, true, false, false);

View File

@@ -90,8 +90,11 @@ void scenarioloader_ui::render_()
const float font_scale_mult = 48 / ImGui::GetFontSize();
// Gradient at the lower half of the screen
const auto tex = reinterpret_cast<ImTextureID>(m_gradient_overlay_tex);
draw_list->AddImage(tex, ImVec2(0, Global.window_size.y / 2), ImVec2(Global.window_size.x, Global.window_size.y), ImVec2(0, 0), ImVec2(1, 1));
if (!Global.NvRenderer)
{
const auto tex = reinterpret_cast<ImTextureID>(m_gradient_overlay_tex);
draw_list->AddImage(tex, ImVec2(0, Global.window_size.y / 2), ImVec2(Global.window_size.x, Global.window_size.y), ImVec2(0, 0), ImVec2(1, 1));
}
// [O] Loading...
const float margin_left_icon = 35.0f;
@@ -175,6 +178,8 @@ void scenarioloader_ui::render_()
void scenarioloader_ui::generate_gradient_tex()
{
if (Global.NvRenderer)
return;
constexpr int image_width = 1;
constexpr int image_height = 256;
const auto image_data = new char[image_width * image_height * 4];