Преглед на файлове

direct volume rendering tweaks and fixes

Alexander Rose преди 6 години
родител
ревизия
8c13f7b8ba
променени са 3 файла, в които са добавени 17 реда и са изтрити 13 реда
  1. 2 2
      src/mol-geo/geometry/direct-volume/direct-volume.ts
  2. 1 1
      src/mol-gl/shader/direct-volume.frag
  3. 14 10
      src/mol-model/structure/structure/unit.ts

+ 2 - 2
src/mol-geo/geometry/direct-volume/direct-volume.ts

@@ -74,8 +74,8 @@ export namespace DirectVolume {
         isoValue: PD.Numeric(0.22, { min: -1, max: 1, step: 0.01 }),
         renderMode: PD.Select('volume', RenderModeOptions),
         controlPoints: PD.LineGraph([
-            Vec2.create(0.19, 0.0), Vec2.create(0.2, 0.15), Vec2.create(0.21, 0.0),
-            Vec2.create(0.79, 0.0), Vec2.create(0.8, 0.15), Vec2.create(0.81, 0.0),
+            Vec2.create(0.19, 0.0), Vec2.create(0.2, 0.05), Vec2.create(0.25, 0.05), Vec2.create(0.26, 0.0),
+            Vec2.create(0.79, 0.0), Vec2.create(0.8, 0.05), Vec2.create(0.85, 0.05), Vec2.create(0.86, 0.0),
         ]),
         list: PD.ColorScale<ColorListName>('RedYellowBlue', ColorListOptions),
     }

+ 1 - 1
src/mol-gl/shader/direct-volume.frag

@@ -91,7 +91,7 @@ const float gradOffset = 0.5;
 
 vec4 raymarch(vec3 startLoc, vec3 step, vec3 viewDir) {
     vec3 scaleVol = vec3(1.0) / uGridDim;
-    vec3 pos = startLoc + scaleVol * 0.5;
+    vec3 pos = startLoc;
     float prevValue = -1.0;
     float value = 0.0;
     vec4 src = vec4(0.0);

+ 14 - 10
src/mol-model/structure/structure/unit.ts

@@ -22,8 +22,10 @@ import { GaussianDensityProps, computeUnitGaussianDensityCached } from './unit/g
 import { RuntimeContext } from 'mol-task';
 import { WebGLContext } from 'mol-gl/webgl/context';
 
-// A building block of a structure that corresponds to an atomic or a coarse grained representation
-// 'conveniently grouped together'.
+/**
+ * A building block of a structure that corresponds to an atomic or
+ * a coarse grained representation 'conveniently grouped together'.
+ */
 type Unit = Unit.Atomic | Unit.Spheres | Unit.Gaussians
 
 namespace Unit {
@@ -114,13 +116,15 @@ namespace Unit {
         return (i: number) => 0;
     }
 
-    // A bulding block of a structure that corresponds
-    // to a "natural group of atoms" (most often a "chain")
-    // together with a tranformation (rotation and translation)
-    // that is dynamically applied to the underlying atom set.
-    //
-    // An atom set can be referenced by multiple diffrent units which
-    // makes construction of assemblies and spacegroups very efficient.
+    /**
+     * A bulding block of a structure that corresponds
+     * to a "natural group of atoms" (most often a "chain")
+     * together with a tranformation (rotation and translation)
+     * that is dynamically applied to the underlying atom set.
+     *
+     * An atom set can be referenced by multiple diffrent units which
+     * makes construction of assemblies and spacegroups very efficient.
+     */
     export class Atomic implements Base {
         readonly kind = Kind.Atomic;
 
@@ -130,7 +134,7 @@ namespace Unit {
         readonly model: Model;
         readonly conformation: SymmetryOperator.ArrayMapping<ElementIndex>;
 
-        // Reference some commonly accessed things for faster access.
+        /** Reference some commonly accessed things for faster access. */
         readonly residueIndex: ArrayLike<ResidueIndex>;
         readonly chainIndex: ArrayLike<ChainIndex>;