summaryrefslogtreecommitdiffstats
path: root/cwd
diff options
context:
space:
mode:
Diffstat (limited to 'cwd')
-rw-r--r--cwd/assets/altcraft/scripts/ui.lua17
-rw-r--r--cwd/assets/altcraft/shaders/frag/light.fs5
-rw-r--r--cwd/assets/altcraft/ui/options.rml6
3 files changed, 19 insertions, 9 deletions
diff --git a/cwd/assets/altcraft/scripts/ui.lua b/cwd/assets/altcraft/scripts/ui.lua
index 10791d1..938088f 100644
--- a/cwd/assets/altcraft/scripts/ui.lua
+++ b/cwd/assets/altcraft/scripts/ui.lua
@@ -1,12 +1,13 @@
local options = {
- gamma = 2.2,
- flight = false,
- mouseSensetivity = 0.1,
- renderDistance = 2,
- resolutionScale = 1.0,
- targetFps = 60,
- vsync = false,
- wireframe = false
+ gamma = 2.2,
+ flight = false,
+ mouseSensetivity = 0.1,
+ renderDistance = 2,
+ resolutionScale = 1.0,
+ targetFps = 60,
+ vsync = false,
+ wireframe = false,
+ ssao = false,
}
function OpenOptions(doc)
diff --git a/cwd/assets/altcraft/shaders/frag/light.fs b/cwd/assets/altcraft/shaders/frag/light.fs
index 8556770..5b2de5d 100644
--- a/cwd/assets/altcraft/shaders/frag/light.fs
+++ b/cwd/assets/altcraft/shaders/frag/light.fs
@@ -13,6 +13,7 @@ uniform sampler2D light;
uniform sampler2D ssao;
uniform int renderBuff;
+uniform bool applySsao;
layout (std140) uniform Globals {
mat4 projView;
@@ -41,7 +42,9 @@ void main() {
float skyLight = l.g;
float lightLevel = clamp(faceLight + skyLight * dayTime, 0.01f, 1.0f);
lightLevel = pow(lightLevel, 3);
- lightLevel *= (1.0f - s.r);
+ if (applySsao) {
+ lightLevel *= (1.0f - s.r);
+ }
lightLevel = clamp(lightLevel, 0.005f, 1.0f);
vec3 faceColor = mix(ac.rgb * lightLevel, vec3(1,1,1) * lightLevel, float(ac.rgb == vec3(0,0,0)));
diff --git a/cwd/assets/altcraft/ui/options.rml b/cwd/assets/altcraft/ui/options.rml
index c5758be..9aa4624 100644
--- a/cwd/assets/altcraft/ui/options.rml
+++ b/cwd/assets/altcraft/ui/options.rml
@@ -54,6 +54,12 @@
<input type="checkbox" id="wireframe" />
<span id="wireframe-val"></span>
</div>
+
+ <div class="option">
+ <label>Ambient occlusion</label>
+ <input type="checkbox" id="ssao" />
+ <span id="ssao-val"></span>
+ </div>
</form>
<button class="mc-button" id="done" onclick="CloseOptions(document)">Done</button>