Skip to content
Snippets Groups Projects
Commit 212a3eeb authored by Alexander Rose's avatar Alexander Rose
Browse files

tweaked auto color smoothing props

parent 17b25354
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ import { MeshValues } from '../../../../mol-gl/renderable/mesh'; ...@@ -10,6 +10,7 @@ import { MeshValues } from '../../../../mol-gl/renderable/mesh';
import { TextureMeshValues } from '../../../../mol-gl/renderable/texture-mesh'; import { TextureMeshValues } from '../../../../mol-gl/renderable/texture-mesh';
import { WebGLContext } from '../../../../mol-gl/webgl/context'; import { WebGLContext } from '../../../../mol-gl/webgl/context';
import { Texture } from '../../../../mol-gl/webgl/texture'; import { Texture } from '../../../../mol-gl/webgl/texture';
import { smoothstep } from '../../../../mol-math/interpolate';
import { Theme } from '../../../../mol-theme/theme'; import { Theme } from '../../../../mol-theme/theme';
import { ValueCell } from '../../../../mol-util'; import { ValueCell } from '../../../../mol-util';
import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
...@@ -33,13 +34,9 @@ export function getColorSmoothingProps(props: PD.Values<ColorSmoothingParams>, t ...@@ -33,13 +34,9 @@ export function getColorSmoothingProps(props: PD.Values<ColorSmoothingParams>, t
resolution *= props.smoothColors.params.resolutionFactor; resolution *= props.smoothColors.params.resolutionFactor;
stride = props.smoothColors.params.sampleStride; stride = props.smoothColors.params.sampleStride;
} else { } else {
if (resolution > 0.5 && resolution < 1) { // https://graphtoy.com/?f1(x,t)=(2-smoothstep(0,1.1,x))*x&coords=0.7,0.6,1.8
resolution *= 2 * resolution; resolution *= 2 - smoothstep(0, 1.1, resolution);
} else if (resolution > 1) { if (resolution > 0.8) stride = 3;
stride = 3;
} else {
resolution *= 2;
}
} }
return { resolution, stride, webgl }; return { resolution, stride, webgl };
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment