Преглед изворни кода

sreenshot tweaks

- don't turn of screenspace antialiasing
- use higher numbr of AO samples than default
Alexander Rose пре 3 година
родитељ
комит
7bfc1b0ebc
1 измењених фајлова са 8 додато и 2 уклоњено
  1. 8 2
      src/mol-plugin/util/viewport-screenshot.ts

+ 8 - 2
src/mol-plugin/util/viewport-screenshot.ts

@@ -108,6 +108,7 @@ class ViewportScreenshotHelper extends PluginComponent {
     private createPass(mutlisample: boolean) {
     private createPass(mutlisample: boolean) {
         const c = this.plugin.canvas3d!;
         const c = this.plugin.canvas3d!;
         const { colorBufferFloat, textureFloat } = c.webgl.extensions;
         const { colorBufferFloat, textureFloat } = c.webgl.extensions;
+        const aoProps = this.plugin.canvas3d!.props.postprocessing.occlusion;
         return this.plugin.canvas3d!.getImagePass({
         return this.plugin.canvas3d!.getImagePass({
             transparentBackground: this.values.transparent,
             transparentBackground: this.values.transparent,
             cameraHelper: { axes: this.values.axes },
             cameraHelper: { axes: this.values.axes },
@@ -117,7 +118,9 @@ class ViewportScreenshotHelper extends PluginComponent {
             },
             },
             postprocessing: {
             postprocessing: {
                 ...c.props.postprocessing,
                 ...c.props.postprocessing,
-                antialiasing: { name: 'off', params: {} }
+                occlusion: aoProps.name === 'on'
+                    ? { name: 'on', params: { ...aoProps.params, samples: 128 } }
+                    : aoProps
             }
             }
         });
         });
     }
     }
@@ -130,13 +133,16 @@ class ViewportScreenshotHelper extends PluginComponent {
     private _imagePass: ImagePass;
     private _imagePass: ImagePass;
     get imagePass() {
     get imagePass() {
         if (this._imagePass) {
         if (this._imagePass) {
+            const aoProps = this.plugin.canvas3d!.props.postprocessing.occlusion;
             this._imagePass.setProps({
             this._imagePass.setProps({
                 cameraHelper: { axes: this.values.axes },
                 cameraHelper: { axes: this.values.axes },
                 transparentBackground: this.values.transparent,
                 transparentBackground: this.values.transparent,
                 // TODO: optimize because this creates a copy of a large object!
                 // TODO: optimize because this creates a copy of a large object!
                 postprocessing: {
                 postprocessing: {
                     ...this.plugin.canvas3d!.props.postprocessing,
                     ...this.plugin.canvas3d!.props.postprocessing,
-                    antialiasing: { name: 'off', params: {} }
+                    occlusion: aoProps.name === 'on'
+                        ? { name: 'on', params: { ...aoProps.params, samples: 128 } }
+                        : aoProps
                 }
                 }
             });
             });
             return this._imagePass;
             return this._imagePass;