Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / menu.js
diff options
context:
space:
mode:
Commitce3ddd0ac87e9642851759a92fc99b24339533f6 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-28 12:09:33 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-28 12:09:33 +0300
Filesb8c53d88a38a331bef56d89b8addb430f0dc3b90 /Year 2/Computer Graphics with WebGL/Project/menu.js
uni-projects-ce3ddd0ac87e9642851759a92fc99b24339533f6.tar
uni-projects-ce3ddd0ac87e9642851759a92fc99b24339533f6.tar.gz
uni-projects-ce3ddd0ac87e9642851759a92fc99b24339533f6.zip
Parentbaade692399d125001e00d08afc68c1e253eaae4 (diff)
[WGL/P] Added a setting for disabling ray marching
1 files changed, 7 insertions, 0 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/menu.js7
diff --git a/Year 2/Computer Graphics with WebGL/Project/menu.js b/Year 2/Computer Graphics with WebGL/Project/menu.js
index db3ee42..10cac05 100644
--- a/Year 2/Computer Graphics with WebGL/Project/menu.js
+++ b/Year 2/Computer Graphics with WebGL/Project/menu.js
@@ -1,6 +1,7 @@
function initMenu() {
initLevels();
debugChange.call(debugModeCB);
+ toggleRayMarching.call(disableRayMarching);
}
/* Level items */
@@ -64,6 +65,12 @@ function fpsCBChange() {
fpsCBChange.call(fpsCB);
fpsCB.addEventListener('change', fpsCBChange);
+const disableRayMarching = document.getElementById('disable-ray-marching');
+function toggleRayMarching() {
+ gl.uniform1i(uDisableRayMarching, this.checked);
+}
+disableRayMarching.addEventListener('change', toggleRayMarching);
+
const onlyHorizontalCB = document.getElementById('only-horizontal');
function horChange() {
onlyHorizontal = this.checked;