diff --git a/manul/renderer/source/config.cpp b/manul/renderer/source/config.cpp index 83a2b36c..bc067076 100644 --- a/manul/renderer/source/config.cpp +++ b/manul/renderer/source/config.cpp @@ -13,6 +13,7 @@ void MaConfig::Init(const YAML::Node& node) { m_lighting.Init(node["lighting"]); m_weight_lines = node["wire_diameter_lines"].as(.01f); m_weight_tractions = node["wire_diameter_tractions"].as(.005f); + m_envmap_resolution = node["envmap_resolution"].as(256); } void MaConfig::MaConfigDisplay::Init(const YAML::Node& node) { diff --git a/manul/renderer/source/config.h b/manul/renderer/source/config.h index 7a0e87f3..fee23692 100644 --- a/manul/renderer/source/config.h +++ b/manul/renderer/source/config.h @@ -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 { diff --git a/manul/renderer/source/environment.cpp b/manul/renderer/source/environment.cpp index 0bc83d8d..0840c37d 100644 --- a/manul/renderer/source/environment.cpp +++ b/manul/renderer/source/environment.cpp @@ -3,6 +3,7 @@ #include #include +#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(floor(log2(skybox_width))) + 1; int dynamic_skybox_mips = static_cast(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(