Browse Source

tweak alpha-orbitals example

- remove direct-volume option
- enable tryUseGpu for isosurface repr
Alexander Rose 3 years ago
parent
commit
f2119b1d0b
2 changed files with 2 additions and 16 deletions
  1. 1 2
      src/examples/alpha-orbitals/index.ts
  2. 1 14
      src/extensions/alpha-orbitals/transforms.ts

+ 1 - 2
src/examples/alpha-orbitals/index.ts

@@ -170,12 +170,11 @@ export class AlphaOrbitalsExample {
         return {
             alpha: 0.85,
             color,
-            directVolume: this.state.value.gpuSurface,
             kind,
             relativeIsovalue: this.state.value.isoValue,
             pickable: false,
             xrayShaded: true,
-            tryUseGpu: false
+            tryUseGpu: true
         };
     }
 

+ 1 - 14
src/extensions/alpha-orbitals/transforms.ts

@@ -166,7 +166,6 @@ export const CreateOrbitalRepresentation3D = PluginStateTransform.BuiltIn({
     from: PluginStateObject.Volume.Data,
     to: PluginStateObject.Volume.Representation3D,
     params: {
-        directVolume: PD.Boolean(false),
         relativeIsovalue: PD.Numeric(1, { min: 0.01, max: 5, step: 0.01 }),
         kind: PD.Select<'positive' | 'negative'>('positive', [['positive', 'Positive'], ['negative', 'Negative']]),
         color: PD.Color(ColorNames.blue),
@@ -217,19 +216,7 @@ function volumeParams(plugin: PluginContext, volume: PluginStateObject.Volume.Da
 
     const value = isovalues[params.kind];
 
-    return createVolumeRepresentationParams(plugin, volume.data, params.directVolume ? {
-        type: 'direct-volume',
-        typeParams: {
-            alpha: params.alpha,
-            renderMode: {
-                name: 'isosurface',
-                params: { isoValue: { kind: 'absolute', absoluteValue: (value ?? 1000) * params.relativeIsovalue }, singleLayer: false }
-            },
-            xrayShaded: params.xrayShaded
-        },
-        color: 'uniform',
-        colorParams: { value: params.color }
-    } : {
+    return createVolumeRepresentationParams(plugin, volume.data, {
         type: 'isosurface',
         typeParams: { isoValue: { kind: 'absolute', absoluteValue: (value ?? 1000) * params.relativeIsovalue }, alpha: params.alpha, xrayShaded: params.xrayShaded, tryUseGpu: params.tryUseGpu },
         color: 'uniform',