expose dynamic reflmap resolution in config.manul

This commit is contained in:
WLs50
2025-03-17 16:44:20 +01:00
parent 91a03dbcd4
commit deee34e370
3 changed files with 7 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ void MaConfig::Init(const YAML::Node& node) {
m_lighting.Init(node["lighting"]);
m_weight_lines = node["wire_diameter_lines"].as<float>(.01f);
m_weight_tractions = node["wire_diameter_tractions"].as<float>(.005f);
m_envmap_resolution = node["envmap_resolution"].as<int>(256);
}
void MaConfig::MaConfigDisplay::Init(const YAML::Node& node) {

View File

@@ -38,6 +38,7 @@ struct MaConfig {
float m_min_luminance_ev;
float m_max_luminance_ev;
} m_lighting;
int m_envmap_resolution;
float m_weight_lines;
float m_weight_tractions;
struct MaConfigShadow {

View File

@@ -3,6 +3,7 @@
#include <fmt/format.h>
#include <nvrhi/utils.h>
#include "config.h"
#include "gbuffer.h"
#include "nvrenderer/nvrenderer.h"
#include "nvrendererbackend.h"
@@ -234,14 +235,14 @@ void MaEnvironment::Init(const std::string& texture, float pre_exposure) {
.addBindingLayout(m_bl_integrate_brdf)
.setComputeShader(m_cs_integrate_brdf));
int skybox_width = 2048;
int dynamic_skybox_width = 512;
int skybox_width = NvRenderer::Config()->m_envmap_resolution;
int dynamic_skybox_width = NvRenderer::Config()->m_envmap_resolution;
int skybox_mips = static_cast<int>(floor(log2(skybox_width))) + 1;
int dynamic_skybox_mips =
static_cast<int>(floor(log2(dynamic_skybox_width))) + 1;
int diffuse_width = 64;
int specular_width = 1024;
int dynamic_specular_width = 256;
int specular_width = NvRenderer::Config()->m_envmap_resolution;
int dynamic_specular_width = NvRenderer::Config()->m_envmap_resolution;
int specular_mips = 6;
m_skybox = m_backend->GetDevice()->createTexture(