Skip to content

Commit

Permalink
feat: change gain scale from linear to exponential
Browse files Browse the repository at this point in the history
  • Loading branch information
seankmartin committed Feb 5, 2024
1 parent cf48e5d commit 1baaced
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/image_user_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ const LAYER_CONTROLS: LayerControlDefinition<ImageUserLayer>[] = [
isValid: (layer) => layer.volumeRendering,
...rangeLayerControl((layer) => ({
value: layer.volumeRenderingGain,
options: { min: 0.01, max: 16.0, step: 0.01 },
options: { min: -10.0, max: 10.0, step: 0.1 },
})),
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/volume_rendering/volume_render_layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void main() {
const farLimitFraction = (adjustedFar - near) / (far - near);
gl.uniform1f(shader.uniform("uNearLimitFraction"), nearLimitFraction);
gl.uniform1f(shader.uniform("uFarLimitFraction"), farLimitFraction);
gl.uniform1f(shader.uniform("uGain"), this.gain.value);
gl.uniform1f(shader.uniform("uGain"), Math.exp(this.gain.value));
gl.uniform1i(
shader.uniform("uMaxSteps"),
this.depthSamplesTarget.value,
Expand Down

0 comments on commit 1baaced

Please sign in to comment.