Added gamma setting
This commit is contained in:
parent
4fd398844e
commit
a7ac539429
@ -32,6 +32,7 @@ toml::Wrapper* create_wrapper(EngineSettings& settings) {
|
||||
camera.add("sensitivity", &settings.camera.sensitivity);
|
||||
|
||||
toml::Section& graphics = wrapper->add("graphics");
|
||||
graphics.add("gamma", &settings.graphics.gamma);
|
||||
graphics.add("fog-curve", &settings.graphics.fogCurve);
|
||||
graphics.add("backlight", &settings.graphics.backlight);
|
||||
graphics.add("frustum-culling", &settings.graphics.frustumCulling);
|
||||
|
||||
@ -157,7 +157,7 @@ void WorldRenderer::draw(const GfxContext& pctx, Camera* camera, bool hudVisible
|
||||
shader->use();
|
||||
shader->uniformMatrix("u_proj", camera->getProjection());
|
||||
shader->uniformMatrix("u_view", camera->getView());
|
||||
shader->uniform1f("u_gamma", 1.0f);
|
||||
shader->uniform1f("u_gamma", settings.graphics.gamma);
|
||||
shader->uniform1f("u_fogFactor", fogFactor);
|
||||
shader->uniform1f("u_fogCurve", settings.graphics.fogCurve);
|
||||
shader->uniform3f("u_cameraPos", camera->position);
|
||||
|
||||
@ -47,6 +47,7 @@ struct GraphicsSettings {
|
||||
/* Fog opacity is calculated as `pow(depth*k, fogCurve)` where k depends on chunksLoadDistance.
|
||||
Use values in range [1.0 - 2.0] where 1.0 is linear, 2.0 is quadratic */
|
||||
float fogCurve = 1.6f;
|
||||
float gamma = 1.0f;
|
||||
/* Enable blocks backlight to prevent complete darkness */
|
||||
bool backlight = true;
|
||||
/* Enable chunks frustum culling */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user