Skip to content

Commit

Permalink
feat: add single config option for uniform lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
MShinkle committed Dec 3, 2024
1 parent 915ed73 commit cb1a0a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions cortex/defaults.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ filter = url(#dropshadow)
voxlines = false
voxline_color = #FFFFFF
voxline_width = 0.01
uniform_illumination = false # Overwrites emissive, specular, and diffuse to have uniform lighting
specularity = 1.0
overlayscale = 1
anim_speed = 2
Expand Down
7 changes: 7 additions & 0 deletions cortex/webgl/resources/js/mriview_surface.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ var mriview = (function(module) {
}
]);

// Update uniform values based on the uniform illumination option
if (viewopts.uniform_illumination == 'true') {
this.uniforms.diffuse.value.set(0, 0, 0); // Set diffuse to 0
this.uniforms.specular.value.set(0, 0, 0); // Set specular to 0
this.uniforms.emissive.value.set(1, 1, 1); // Set emissive to 1
}

this.ui = (new jsplot.Menu()).add({
unfold: {action:[this, "setMix", 0., 1.]},
pivot: {action:[this, "setPivot", -180, 180]},
Expand Down

0 comments on commit cb1a0a8

Please sign in to comment.