Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / menu.js
diff options
context:
space:
mode:
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;