mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'graphics.clouds-quality' setting
This commit is contained in:
parent
8153ddde89
commit
1194379f99
7 changed files with 18 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<container size='668,418' color='#0F1E2DB2' context='menu'>
|
<container size='668,444' color='#0F1E2DB2' context='menu'>
|
||||||
<panel pos='6' size='250' color='0' interval='1'>
|
<panel pos='6' size='250' color='0' interval='1'>
|
||||||
<button id='s_aud' onclick='sections:set("audio")'>@Audio</button>
|
<button id='s_aud' onclick='sections:set("audio")'>@Audio</button>
|
||||||
<button id='s_dsp' onclick='sections:set("display")'>@Display</button>
|
<button id='s_dsp' onclick='sections:set("display")'>@Display</button>
|
||||||
|
|
|
||||||
|
|
@ -39,11 +39,12 @@ function on_open()
|
||||||
create_setting("chunks.load-distance", "Load Distance", 1)
|
create_setting("chunks.load-distance", "Load Distance", 1)
|
||||||
create_setting("chunks.load-speed", "Load Speed", 1)
|
create_setting("chunks.load-speed", "Load Speed", 1)
|
||||||
create_setting("graphics.fog-curve", "Fog Curve", 0.1)
|
create_setting("graphics.fog-curve", "Fog Curve", 0.1)
|
||||||
|
|
||||||
create_checkbox("graphics.backlight", "Backlight", "graphics.backlight.tooltip")
|
create_checkbox("graphics.backlight", "Backlight", "graphics.backlight.tooltip")
|
||||||
create_checkbox("graphics.soft-lighting", "Soft lighting", "graphics.soft-lighting.tooltip")
|
create_checkbox("graphics.soft-lighting", "Soft lighting", "graphics.soft-lighting.tooltip")
|
||||||
create_checkbox("graphics.dense-render", "Dense blocks render", "graphics.dense-render.tooltip")
|
create_checkbox("graphics.dense-render", "Dense blocks render", "graphics.dense-render.tooltip")
|
||||||
create_checkbox("graphics.advanced-render", "Advanced render", "graphics.advanced-render.tooltip")
|
create_checkbox("graphics.advanced-render", "Advanced render", "graphics.advanced-render.tooltip")
|
||||||
create_setting("graphics.ssao", "SSAO", 1, "", "graphics.ssao.tooltip")
|
create_setting("graphics.ssao", "SSAO", 1, "", "graphics.ssao.tooltip")
|
||||||
create_setting("graphics.shadows-quality", "Shadows quality", 1)
|
create_setting("graphics.shadows-quality", "Shadows quality", 1)
|
||||||
|
create_setting("graphics.clouds-quality", "Clouds quality", 1)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,8 @@ void CloudsRenderer::draw(
|
||||||
const Weather& weather,
|
const Weather& weather,
|
||||||
float timer,
|
float timer,
|
||||||
float fogFactor,
|
float fogFactor,
|
||||||
const Camera& camera
|
const Camera& camera,
|
||||||
|
int quality
|
||||||
) {
|
) {
|
||||||
float clouds = weather.clouds();
|
float clouds = weather.clouds();
|
||||||
shader.uniform4f(
|
shader.uniform4f(
|
||||||
|
|
@ -247,7 +248,7 @@ void CloudsRenderer::draw(
|
||||||
int cellZ = glm::floor(camera.position.z / totalDepth + 0.5f);
|
int cellZ = glm::floor(camera.position.z / totalDepth + 0.5f);
|
||||||
|
|
||||||
float speed = 4.0f;
|
float speed = 4.0f;
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < std::min<int>(quality, testMeshes.size()); i++) {
|
||||||
float speedX = glm::sin(i * 0.3f + 0.4f) * speed / (i + 1);
|
float speedX = glm::sin(i * 0.3f + 0.4f) * speed / (i + 1);
|
||||||
float speedZ = -glm::cos(i * 0.3f + 0.4f) * speed / (i + 1);
|
float speedZ = -glm::cos(i * 0.3f + 0.4f) * speed / (i + 1);
|
||||||
for (int x = -2; x <= 2; x++) {
|
for (int x = -2; x <= 2; x++) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@ public:
|
||||||
const Weather& weather,
|
const Weather& weather,
|
||||||
float timer,
|
float timer,
|
||||||
float fogFactor,
|
float fogFactor,
|
||||||
const Camera& camera
|
const Camera& camera,
|
||||||
|
int quality
|
||||||
);
|
);
|
||||||
private:
|
private:
|
||||||
std::array<std::unique_ptr<Mesh<ChunkVertex>>, 2> testMeshes;
|
std::array<std::unique_ptr<Mesh<ChunkVertex>>, 2> testMeshes;
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,13 @@ void WorldRenderer::renderOpaque(
|
||||||
chunksRenderer->drawChunks(camera, shader);
|
chunksRenderer->drawChunks(camera, shader);
|
||||||
blockWraps->draw(ctx, player);
|
blockWraps->draw(ctx, player);
|
||||||
|
|
||||||
setupWorldShader(cloudsShader, camera, settings, fogFactor);
|
int cloudsQuality = settings.graphics.cloudsQuality.get();
|
||||||
cloudsRenderer->draw(cloudsShader, weather, timer, fogFactor, camera);
|
if (cloudsQuality > 0) {
|
||||||
|
setupWorldShader(cloudsShader, camera, settings, fogFactor);
|
||||||
|
cloudsRenderer->draw(
|
||||||
|
cloudsShader, weather, timer, fogFactor, camera, cloudsQuality
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (hudVisible) {
|
if (hudVisible) {
|
||||||
renderLines(camera, linesShader, ctx);
|
renderLines(camera, linesShader, ctx);
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ SettingsHandler::SettingsHandler(EngineSettings& settings) {
|
||||||
builder.add("shadows-quality", &settings.graphics.shadowsQuality);
|
builder.add("shadows-quality", &settings.graphics.shadowsQuality);
|
||||||
builder.add("dense-render-distance", &settings.graphics.denseRenderDistance);
|
builder.add("dense-render-distance", &settings.graphics.denseRenderDistance);
|
||||||
builder.add("soft-lighting", &settings.graphics.softLighting);
|
builder.add("soft-lighting", &settings.graphics.softLighting);
|
||||||
|
builder.add("clouds-quality", &settings.graphics.cloudsQuality);
|
||||||
|
|
||||||
builder.addSection("ui");
|
builder.addSection("ui");
|
||||||
builder.add("language", &settings.ui.language);
|
builder.add("language", &settings.ui.language);
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,8 @@ struct GraphicsSettings {
|
||||||
IntegerSetting denseRenderDistance {56, 0, 10'000};
|
IntegerSetting denseRenderDistance {56, 0, 10'000};
|
||||||
/// @brief Soft lighting for blocks
|
/// @brief Soft lighting for blocks
|
||||||
FlagSetting softLighting {true};
|
FlagSetting softLighting {true};
|
||||||
|
/// @brief Clouds quality level
|
||||||
|
IntegerSetting cloudsQuality {2, 0, 2};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PathfindingSettings {
|
struct PathfindingSettings {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue