Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow shaders with disabled post processing pipeline #14338

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 17 additions & 11 deletions builtin/settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ anisotropic_filter (Anisotropic filtering) bool false
#
# * None - No antialiasing (default)
#
# * FSAA - Hardware-provided full-screen antialiasing (incompatible with shaders)
# * FSAA - Hardware-provided full-screen antialiasing
# (incompatible with Post Processing and Undersampling)
# A.K.A multi-sample antialiasing (MSAA)
# Smoothens out block edges but does not affect the insides of textures.
# A restart is required to change this option.
Expand Down Expand Up @@ -556,27 +557,32 @@ shadow_sky_body_orbit_tilt (Sky Body Orbit Tilt) float 0.0 -60.0 60.0

[**Post Processing]

# Enables the post processing pipeline.
#
# Requires: shaders
enable_post_processing (Enable Post Processing) bool true

# Enables Hable's 'Uncharted 2' filmic tone mapping.
# Simulates the tone curve of photographic film and how this approximates the
# appearance of high dynamic range images. Mid-range contrast is slightly
# enhanced, highlights and shadows are gradually compressed.
#
# Requires: shaders
# Requires: shaders, enable_post_processing
tone_mapping (Filmic tone mapping) bool false

# Enable automatic exposure correction
# When enabled, the post-processing engine will
# automatically adjust to the brightness of the scene,
# simulating the behavior of human eye.
#
# Requires: shaders
# Requires: shaders, enable_post_processing
enable_auto_exposure (Enable Automatic Exposure) bool false

# Set the exposure compensation in EV units.
# Value of 0.0 (default) means no exposure compensation.
# Range: from -1 to 1.0
#
# Requires: shaders, enable_auto_exposure
# Requires: shaders, enable_post_processing, enable_auto_exposure
exposure_compensation (Exposure compensation) float 0.0 -1.0 1.0

# Apply dithering to reduce color banding artifacts.
Expand All @@ -587,48 +593,48 @@ exposure_compensation (Exposure compensation) float 0.0 -1.0 1.0
# With OpenGL ES, dithering only works if the shader supports high
# floating-point precision and it may have a higher performance impact.
#
# Requires: shaders
# Requires: shaders, enable_post_processing
debanding (Enable Debanding) bool true

[**Bloom]

# Set to true to enable bloom effect.
# Bright colors will bleed over the neighboring objects.
#
# Requires: shaders
# Requires: shaders, enable_post_processing
enable_bloom (Enable Bloom) bool false

# Set to true to render debugging breakdown of the bloom effect.
# In debug mode, the screen is split into 4 quadrants:
# top-left - processed base image, top-right - final image
# bottom-left - raw base image, bottom-right - bloom texture.
#
# Requires: shaders, enable_bloom
# Requires: shaders, enable_post_processing, enable_bloom
enable_bloom_debug (Enable Bloom Debug) bool false

# Defines how much bloom is applied to the rendered image
# Smaller values make bloom more subtle
# Range: from 0.01 to 1.0, default: 0.05
#
# Requires: shaders, enable_bloom
# Requires: shaders, enable_post_processing, enable_bloom
bloom_intensity (Bloom Intensity) float 0.05 0.01 1.0

# Defines the magnitude of bloom overexposure.
# Range: from 0.1 to 10.0, default: 1.0
#
# Requires: shaders, enable_bloom
# Requires: shaders, enable_post_processing, enable_bloom
bloom_strength_factor (Bloom Strength Factor) float 1.0 0.1 10.0

# Logical value that controls how far the bloom effect spreads
# from the bright objects.
# Range: from 0.1 to 8, default: 1
#
# Requires: shaders, enable_bloom
# Requires: shaders, enable_post_processing, enable_bloom
bloom_radius (Bloom Radius) float 1 0.1 8

# Set to true to enable volumetric lighting effect (a.k.a. "Godrays").
#
# Requires: shaders, enable_bloom
# Requires: shaders, enable_post_processing, enable_bloom
enable_volumetric_lighting (Volumetric lighting) bool false

[*Audio]
Expand Down
4 changes: 2 additions & 2 deletions src/client/render/plain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void UpscaleStep::run(PipelineContext &context)
std::unique_ptr<RenderStep> create3DStage(Client *client, v2f scale)
{
RenderStep *step = new Draw3D();
if (g_settings->getBool("enable_shaders")) {
if (g_settings->getBool("enable_shaders") && g_settings->getBool("enable_post_processing")) {
RenderPipeline *pipeline = new RenderPipeline();
pipeline->addStep(pipeline->own(std::unique_ptr<RenderStep>(step)));

Expand All @@ -128,7 +128,7 @@ RenderStep* addUpscaling(RenderPipeline *pipeline, RenderStep *previousStep, v2f
return previousStep;

// When shaders are enabled, post-processing pipeline takes care of rescaling
if (g_settings->getBool("enable_shaders"))
if (g_settings->getBool("enable_shaders") && g_settings->getBool("enable_post_processing"))
return previousStep;


Expand Down
2 changes: 2 additions & 0 deletions src/defaultsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ void set_default_settings()
settings->setDefault("minimap_double_scan_height", "true");

// Effects
settings->setDefault("enable_post_processing", "true");
settings->setDefault("directional_colored_fog", "true");
settings->setDefault("inventory_items_animations", "false");
settings->setDefault("mip_map", "false");
Expand Down Expand Up @@ -502,6 +503,7 @@ void set_default_settings()
settings->setDefault("active_block_range", "2");
settings->setDefault("viewing_range", "50");
settings->setDefault("leaves_style", "simple");
settings->setDefault("enable_post_processing", "false");
settings->setDefault("debanding", "false");
settings->setDefault("curl_verify_cert", "false");

Expand Down