瀏覽代碼

color smoothing param tweaks

Alexander Rose 3 年之前
父節點
當前提交
26054681d8
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/mol-repr/structure/visual/util/color.ts

+ 2 - 1
src/mol-repr/structure/visual/util/color.ts

@@ -19,7 +19,7 @@ export const ColorSmoothingParams = {
     smoothColors: PD.MappedStatic('auto', {
         auto: PD.Group({}),
         on: PD.Group({
-            resolutionFactor: PD.Numeric(2, { min: 1, max: 6, step: 0.1 }),
+            resolutionFactor: PD.Numeric(2, { min: 0.5, max: 6, step: 0.1 }),
             sampleStride: PD.Numeric(3, { min: 1, max: 12, step: 1 }),
         }),
         off: PD.Group({})
@@ -37,6 +37,7 @@ export function getColorSmoothingProps(props: PD.Values<ColorSmoothingParams>, t
             // https://graphtoy.com/?f1(x,t)=(2-smoothstep(0,1.1,x))*x&coords=0.7,0.6,1.8
             resolution *= 2 - smoothstep(0, 1.1, resolution);
             resolution = Math.max(0.5, resolution);
+            if (resolution > 1.2) stride = 2;
         }
         return { resolution, stride, webgl };
     };