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

tweak alpha-orbitals example

- remove direct-volume option
- enable tryUseGpu for isosurface repr
parent b4783909
No related branches found
No related tags found
No related merge requests found
...@@ -170,12 +170,11 @@ export class AlphaOrbitalsExample { ...@@ -170,12 +170,11 @@ export class AlphaOrbitalsExample {
return { return {
alpha: 0.85, alpha: 0.85,
color, color,
directVolume: this.state.value.gpuSurface,
kind, kind,
relativeIsovalue: this.state.value.isoValue, relativeIsovalue: this.state.value.isoValue,
pickable: false, pickable: false,
xrayShaded: true, xrayShaded: true,
tryUseGpu: false tryUseGpu: true
}; };
} }
......
...@@ -166,7 +166,6 @@ export const CreateOrbitalRepresentation3D = PluginStateTransform.BuiltIn({ ...@@ -166,7 +166,6 @@ export const CreateOrbitalRepresentation3D = PluginStateTransform.BuiltIn({
from: PluginStateObject.Volume.Data, from: PluginStateObject.Volume.Data,
to: PluginStateObject.Volume.Representation3D, to: PluginStateObject.Volume.Representation3D,
params: { params: {
directVolume: PD.Boolean(false),
relativeIsovalue: PD.Numeric(1, { min: 0.01, max: 5, step: 0.01 }), relativeIsovalue: PD.Numeric(1, { min: 0.01, max: 5, step: 0.01 }),
kind: PD.Select<'positive' | 'negative'>('positive', [['positive', 'Positive'], ['negative', 'Negative']]), kind: PD.Select<'positive' | 'negative'>('positive', [['positive', 'Positive'], ['negative', 'Negative']]),
color: PD.Color(ColorNames.blue), color: PD.Color(ColorNames.blue),
...@@ -217,19 +216,7 @@ function volumeParams(plugin: PluginContext, volume: PluginStateObject.Volume.Da ...@@ -217,19 +216,7 @@ function volumeParams(plugin: PluginContext, volume: PluginStateObject.Volume.Da
const value = isovalues[params.kind]; const value = isovalues[params.kind];
return createVolumeRepresentationParams(plugin, volume.data, params.directVolume ? { return createVolumeRepresentationParams(plugin, volume.data, {
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 }
} : {
type: 'isosurface', type: 'isosurface',
typeParams: { isoValue: { kind: 'absolute', absoluteValue: (value ?? 1000) * params.relativeIsovalue }, alpha: params.alpha, xrayShaded: params.xrayShaded, tryUseGpu: params.tryUseGpu }, typeParams: { isoValue: { kind: 'absolute', absoluteValue: (value ?? 1000) * params.relativeIsovalue }, alpha: params.alpha, xrayShaded: params.xrayShaded, tryUseGpu: params.tryUseGpu },
color: 'uniform', color: 'uniform',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment