Forráskód Böngészése

improve CellPack's adjustStyle option

- disable colorMarker
- set component options
- enable marking w/o ghost
Alexander Rose 2 éve
szülő
commit
f9841dd3df
2 módosított fájl, 12 hozzáadás és 0 törlés
  1. 1 0
      CHANGELOG.md
  2. 11 0
      src/extensions/cellpack/model.ts

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ Note that since we don't clearly distinguish between a public and private interf
 - Fix missing 'material' annotation for some uniforms, causing unnecessary uniform updates
 - Remove use of ``isnan`` in impostor shaders, not needed and causing slowdown
 - Avoid using ``flat`` qualifier in shaders, causing slowdown
+- Improve CellPack's ``adjustStyle`` option (disable ``colorMarker``, set component options, enable marking w/o ghost)
 
 ## [v3.11.0] - 2022-07-04
 

+ 11 - 0
src/extensions/cellpack/model.ts

@@ -581,9 +581,20 @@ export const LoadCellPackModel = StateAction.build({
 })(({ state, params }, ctx: PluginContext) => Task.create('CellPack Loader', async taskCtx => {
     if (params.preset.adjustStyle) {
         ctx.managers.interactivity.setProps({ granularity: 'chain' });
+        ctx.managers.structure.component.setOptions({
+            ... ctx.managers.structure.component.state.options,
+            visualQuality: 'custom',
+            ignoreLight: true,
+            showHydrogens: false,
+        });
         ctx.canvas3d?.setProps({
             multiSample: { mode: 'off' },
             cameraClipping: { far: false },
+            renderer: { colorMarker: false },
+            marking: {
+                enabled: true,
+                ghostEdgeStrength: 1,
+            },
             postprocessing: {
                 occlusion: {
                     name: 'on',