Merge pull request #669 from MihailRis/ability-to-turn-off-soft-lighting
Ability to turn-off soft lighting
This commit is contained in:
commit
d5469acb55
@ -70,4 +70,5 @@ function on_open()
|
||||
create_checkbox("camera.inertia", "Camera Inertia")
|
||||
create_checkbox("camera.fov-effects", "Camera FOV Effects")
|
||||
create_checkbox("display.limit-fps-iconified", "Limit Background FPS")
|
||||
create_setting("graphics.gamma", "Gamma", 0.05, "", "graphics.gamma.tooltip")
|
||||
end
|
||||
|
||||
@ -39,8 +39,9 @@ function on_open()
|
||||
create_setting("chunks.load-distance", "Load Distance", 1)
|
||||
create_setting("chunks.load-speed", "Load Speed", 1)
|
||||
create_setting("graphics.fog-curve", "Fog Curve", 0.1)
|
||||
create_setting("graphics.gamma", "Gamma", 0.05, "", "graphics.gamma.tooltip")
|
||||
|
||||
create_checkbox("graphics.backlight", "Backlight", "graphics.backlight.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.advanced-render", "Advanced render", "graphics.advanced-render.tooltip")
|
||||
create_checkbox("graphics.ssao", "SSAO", "graphics.ssao.tooltip")
|
||||
|
||||
@ -20,6 +20,7 @@ devtools.output=Output
|
||||
graphics.gamma.tooltip=Lighting brightness curve
|
||||
graphics.backlight.tooltip=Backlight to prevent total darkness
|
||||
graphics.dense-render.tooltip=Enables transparency in blocks like leaves
|
||||
graphics.soft-lighting.tooltip=Enables blocks soft lighting
|
||||
|
||||
# settings
|
||||
settings.Controls Search Mode=Search by attached button name
|
||||
|
||||
@ -39,7 +39,8 @@ pack.remove-confirm=Удалить весь поставляемый паком/
|
||||
# Подсказки
|
||||
graphics.gamma.tooltip=Кривая яркости освещения
|
||||
graphics.backlight.tooltip=Подсветка, предотвращающая полную темноту
|
||||
graphics.dense-render.tooltip=Включает прозрачность блоков, таких как листья.
|
||||
graphics.dense-render.tooltip=Включает прозрачность блоков, таких как листья
|
||||
graphics.soft-lighting.tooltip=Включает мягкое освещение у блоков
|
||||
|
||||
# Меню
|
||||
menu.Apply=Применить
|
||||
@ -80,6 +81,7 @@ world.delete-confirm=Удалить мир безвозвратно?
|
||||
settings.Ambient=Фон
|
||||
settings.Backlight=Подсветка
|
||||
settings.Dense blocks render=Плотный рендер блоков
|
||||
settings.Soft lighting=Мягкое освещение
|
||||
settings.Camera Shaking=Тряска Камеры
|
||||
settings.Camera Inertia=Инерция Камеры
|
||||
settings.Camera FOV Effects=Эффекты поля зрения
|
||||
|
||||
@ -76,13 +76,14 @@ LevelScreen::LevelScreen(
|
||||
engine, *controller, *renderer, assets, *player
|
||||
);
|
||||
|
||||
keepAlive(settings.graphics.backlight.observe([=](bool) {
|
||||
player->chunks->saveAndClear();
|
||||
renderer->clear();
|
||||
}));
|
||||
keepAlive(settings.graphics.denseRender.observe([=](bool) {
|
||||
auto resetChunks = [=](bool) {
|
||||
player->chunks->saveAndClear();
|
||||
renderer->clear();
|
||||
};
|
||||
keepAlive(settings.graphics.backlight.observe(resetChunks));
|
||||
keepAlive(settings.graphics.softLighting.observe(resetChunks));
|
||||
keepAlive(settings.graphics.denseRender.observe([=](bool flag) {
|
||||
resetChunks(flag);
|
||||
frontend->getContentGfxCache().refresh();
|
||||
}));
|
||||
keepAlive(settings.camera.fov.observe([=](double value) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include "lighting/Lightmap.hpp"
|
||||
#include "frontend/ContentGfxCache.hpp"
|
||||
|
||||
const glm::vec3 BlocksRenderer::SUN_VECTOR(0.528265f, 0.833149f, -0.163704f);
|
||||
const glm::vec3 BlocksRenderer::SUN_VECTOR(0.528265, 0.833149, -0.163704);
|
||||
const float DIRECTIONAL_LIGHT_FACTOR = 0.3f;
|
||||
|
||||
BlocksRenderer::BlocksRenderer(
|
||||
@ -35,8 +35,7 @@ BlocksRenderer::BlocksRenderer(
|
||||
blockDefsCache = content.getIndices()->blocks.getDefs();
|
||||
}
|
||||
|
||||
BlocksRenderer::~BlocksRenderer() {
|
||||
}
|
||||
BlocksRenderer::~BlocksRenderer() = default;
|
||||
|
||||
/// Basic vertex add method
|
||||
void BlocksRenderer::vertex(
|
||||
@ -480,6 +479,7 @@ void BlocksRenderer::render(
|
||||
) {
|
||||
bool denseRender = this->denseRender;
|
||||
bool densePass = this->densePass;
|
||||
bool enableAO = settings.graphics.softLighting.get();
|
||||
for (const auto drawGroup : *content.drawGroups) {
|
||||
int begin = beginEnds[drawGroup][0];
|
||||
if (begin == 0) {
|
||||
@ -516,7 +516,7 @@ void BlocksRenderer::render(
|
||||
switch (def.getModel(state.userbits).type) {
|
||||
case BlockModelType::BLOCK:
|
||||
blockCube({x, y, z}, texfaces, def, vox.state, !def.shadeless,
|
||||
def.ambientOcclusion);
|
||||
def.ambientOcclusion && enableAO);
|
||||
break;
|
||||
case BlockModelType::XSPRITE: {
|
||||
if (!denseRender)
|
||||
@ -527,7 +527,7 @@ void BlocksRenderer::render(
|
||||
case BlockModelType::AABB: {
|
||||
if (!denseRender)
|
||||
blockAABB({x, y, z}, texfaces, &def, vox.state.rotation,
|
||||
!def.shadeless, def.ambientOcclusion);
|
||||
!def.shadeless, def.ambientOcclusion && enableAO);
|
||||
break;
|
||||
}
|
||||
case BlockModelType::CUSTOM: {
|
||||
@ -537,7 +537,7 @@ void BlocksRenderer::render(
|
||||
def,
|
||||
vox.state,
|
||||
!def.shadeless,
|
||||
def.ambientOcclusion
|
||||
def.ambientOcclusion && enableAO
|
||||
);
|
||||
break;
|
||||
}
|
||||
@ -561,6 +561,7 @@ SortingMeshData BlocksRenderer::renderTranslucent(
|
||||
size_t totalSize = 0;
|
||||
|
||||
bool densePass = this->densePass;
|
||||
bool enableAO = settings.graphics.softLighting.get();
|
||||
for (const auto drawGroup : *content.drawGroups) {
|
||||
int begin = beginEnds[drawGroup][0];
|
||||
if (begin == 0) {
|
||||
@ -594,7 +595,7 @@ SortingMeshData BlocksRenderer::renderTranslucent(
|
||||
switch (def.getModel(state.userbits).type) {
|
||||
case BlockModelType::BLOCK:
|
||||
blockCube({x, y, z}, texfaces, def, vox.state, !def.shadeless,
|
||||
def.ambientOcclusion);
|
||||
def.ambientOcclusion && enableAO);
|
||||
break;
|
||||
case BlockModelType::XSPRITE: {
|
||||
blockXSprite(x, y, z, glm::vec3(1.0f),
|
||||
@ -602,13 +603,24 @@ SortingMeshData BlocksRenderer::renderTranslucent(
|
||||
break;
|
||||
}
|
||||
case BlockModelType::AABB: {
|
||||
blockAABB({x, y, z}, texfaces, &def, vox.state.rotation,
|
||||
!def.shadeless, def.ambientOcclusion);
|
||||
blockAABB(
|
||||
{x, y, z},
|
||||
texfaces,
|
||||
&def,
|
||||
vox.state.rotation,
|
||||
!def.shadeless,
|
||||
def.ambientOcclusion && enableAO
|
||||
);
|
||||
break;
|
||||
}
|
||||
case BlockModelType::CUSTOM: {
|
||||
blockCustomModel({x, y, z}, def, vox.state,
|
||||
!def.shadeless, def.ambientOcclusion);
|
||||
blockCustomModel(
|
||||
{x, y, z},
|
||||
def,
|
||||
vox.state,
|
||||
!def.shadeless,
|
||||
def.ambientOcclusion && enableAO
|
||||
);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -79,6 +79,7 @@ SettingsHandler::SettingsHandler(EngineSettings& settings) {
|
||||
builder.add("ssao", &settings.graphics.ssao);
|
||||
builder.add("shadows-quality", &settings.graphics.shadowsQuality);
|
||||
builder.add("dense-render-distance", &settings.graphics.denseRenderDistance);
|
||||
builder.add("soft-lighting", &settings.graphics.softLighting);
|
||||
|
||||
builder.section("ui");
|
||||
builder.add("language", &settings.ui.language);
|
||||
|
||||
@ -85,6 +85,8 @@ struct GraphicsSettings {
|
||||
IntegerSetting shadowsQuality {0, 0, 3};
|
||||
/// @brief Dense render distance
|
||||
IntegerSetting denseRenderDistance {56, 0, 10'000};
|
||||
/// @brief Soft lighting for blocks
|
||||
FlagSetting softLighting {true};
|
||||
};
|
||||
|
||||
struct PathfindingSettings {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user