Skip to content

Commit

Permalink
feat: add ui toggle for uniform illumination
Browse files Browse the repository at this point in the history
  • Loading branch information
MShinkle committed Dec 5, 2024
1 parent 411572b commit 87594d7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cortex/webgl/resources/js/mriview_surface.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var mriview = (function(module) {
toggleMultipleLayers: {action: this.toggleMultipleLayers.bind(this), key: 'm', hidden: true, help: "Toggle multiple layers"},
dither: {action:[this, "setDither"]},
sampler: {action:[this, "setSampler", ["nearest", "trilinear"]]},
uniform_illumination: {action:[this, "setUniformIllumination"]},
});


Expand Down Expand Up @@ -853,5 +854,20 @@ var mriview = (function(module) {
this.object.add(this.mesh);
}

module.Surface.prototype.setUniformIllumination = function(val) {
if (val === undefined)
return this.uniforms.emissive.value.x == 1; // Check current state

if (val) {
this.uniforms.diffuse.value.set(0, 0, 0);
this.uniforms.specular.value.set(0, 0, 0);
this.uniforms.emissive.value.set(1, 1, 1);
} else {
this.uniforms.diffuse.value.set(.8, .8, .8);
this.uniforms.specular.value.set(.005, .005, .005);
this.uniforms.emissive.value.set(.2, .2, .2);
}
};

return module;
}(mriview || {}));

0 comments on commit 87594d7

Please sign in to comment.