mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
change 'graphics.ssao' from flag to number
This commit is contained in:
parent
837f49e736
commit
58dee92c26
5 changed files with 21 additions and 10 deletions
|
|
@ -44,6 +44,6 @@ function on_open()
|
||||||
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_checkbox("graphics.ssao", "SSAO", "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)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
"cinematic"
|
"cinematic"
|
||||||
],
|
],
|
||||||
"post-effect-slot": [
|
"post-effect-slot": [
|
||||||
"default"
|
"default",
|
||||||
|
"ssao"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
local function configure_SSAO()
|
local function configure_SSAO()
|
||||||
-- Temporary using slot to configure built-in SSAO effect
|
-- Temporary using slot to configure built-in SSAO effect
|
||||||
local slot = gfx.posteffects.index("core:default")
|
local slot = gfx.posteffects.index("core:ssao")
|
||||||
gfx.posteffects.set_effect(slot, "ssao")
|
gfx.posteffects.set_effect(slot, "ssao")
|
||||||
|
|
||||||
-- Generating random SSAO samples
|
-- Generating random SSAO samples
|
||||||
|
|
@ -18,8 +18,18 @@ local function configure_SSAO()
|
||||||
Bytearray.append(buffer, byteutil.pack("fff", x, y, z))
|
Bytearray.append(buffer, byteutil.pack("fff", x, y, z))
|
||||||
end
|
end
|
||||||
gfx.posteffects.set_array(slot, "u_ssaoSamples", Bytearray_as_string(buffer))
|
gfx.posteffects.set_array(slot, "u_ssaoSamples", Bytearray_as_string(buffer))
|
||||||
-- SSAO effect configured, so 'core:default' slot may be reused now
|
|
||||||
-- for test purposes
|
local function update_ssao_quality(value)
|
||||||
|
value = math.min(value, 3)
|
||||||
|
gfx.posteffects.set_params(slot, {
|
||||||
|
u_kernelSize = value * 16,
|
||||||
|
u_radius = 0.4 / value,
|
||||||
|
u_bias = 0.006 / value / value,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
events.on("core:setting.graphics.ssao.set", update_ssao_quality)
|
||||||
|
|
||||||
|
update_ssao_quality(core.get_setting("graphics.ssao"))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function update_hand()
|
local function update_hand()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#param vec3 u_ssaoSamples[64]
|
#param vec3 u_ssaoSamples[64]
|
||||||
#param int u_kernelSize = 16
|
#param int u_kernelSize = 32
|
||||||
#param float u_radius = 0.4
|
#param float u_radius = 0.2
|
||||||
#param float u_bias = 0.006
|
#param float u_bias = 0.001
|
||||||
|
|
||||||
vec4 effect() {
|
vec4 effect() {
|
||||||
vec2 noiseScale = u_screenSize / 4.0;
|
vec2 noiseScale = u_screenSize / 4.0;
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ struct GraphicsSettings {
|
||||||
IntegerSetting chunkMaxRenderers {6, -4, 32};
|
IntegerSetting chunkMaxRenderers {6, -4, 32};
|
||||||
/// @brief Advanced render pipeline
|
/// @brief Advanced render pipeline
|
||||||
FlagSetting advancedRender {true};
|
FlagSetting advancedRender {true};
|
||||||
/// @brief Screen space ambient occlusion
|
/// @brief Screen space ambient occlusion quality
|
||||||
FlagSetting ssao {true};
|
IntegerSetting ssao {1, 0, 2};
|
||||||
/// @brief Shadows quality
|
/// @brief Shadows quality
|
||||||
IntegerSetting shadowsQuality {0, 0, 3};
|
IntegerSetting shadowsQuality {0, 0, 3};
|
||||||
/// @brief Dense render distance
|
/// @brief Dense render distance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue