diff --git a/src/apps/docking-viewer/viewport.tsx b/src/apps/docking-viewer/viewport.tsx index d26684d7881a78bc9705f3e0a31094ae8c28f617..ba5ce4598a9920a917064968ad97f754706cad07 100644 --- a/src/apps/docking-viewer/viewport.tsx +++ b/src/apps/docking-viewer/viewport.tsx @@ -51,12 +51,12 @@ function occlusionStyle(plugin: PluginContext) { samples: 32, resolutionScale: 1, } }, - shadow: { name: 'off', params: { } }, outline: { name: 'on', params: { scale: 1.0, threshold: 0.33, color: Color(0x0000), - } } + } }, + shadow: { name: 'off', params: {} }, } } }); } diff --git a/src/examples/lighting/index.ts b/src/examples/lighting/index.ts index 287ca851c754dd964a2dc92baaabf0e26f047718..9365e7a7977f28b863476b366ebc910cadea0e85 100644 --- a/src/examples/lighting/index.ts +++ b/src/examples/lighting/index.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ @@ -30,11 +30,9 @@ const Canvas3DPresets = { radius: 5, samples: 32, resolutionScale: 1, - softAO: { name: 'off', params: {} }, - shadow: { name: 'off', params: {} }, - closeAO: { name: 'off', params: {} } } }, - outline: { name: 'on', params: { scale: 1, threshold: 0.33, color: Color(0x000000) } } + outline: { name: 'on', params: { scale: 1, threshold: 0.33, color: Color(0x000000) } }, + shadow: { name: 'off', params: {} }, }, renderer: { ambientIntensity: 1.0, @@ -51,11 +49,9 @@ const Canvas3DPresets = { radius: 5, samples: 32, resolutionScale: 1, - softAO: { name: 'off', params: {} }, - shadow: { name: 'off', params: {} }, - closeAO: { name: 'off', params: {} } } }, - outline: { name: 'off', params: {} } + outline: { name: 'off', params: {} }, + shadow: { name: 'off', params: {} }, }, renderer: { ambientIntensity: 0.4, @@ -68,7 +64,8 @@ const Canvas3DPresets = { canvas3d: <Preset>{ postprocessing: { occlusion: { name: 'off', params: {} }, - outline: { name: 'off', params: {} } + outline: { name: 'off', params: {} }, + shadow: { name: 'off', params: {} }, }, renderer: { ambientIntensity: 0.4, diff --git a/src/mol-canvas3d/passes/postprocessing.ts b/src/mol-canvas3d/passes/postprocessing.ts index 11980c1827f753b7b692fe0e714060b67185889b..19fad59b53003dbb5c0a70e2d0f59ac021e22ffe 100644 --- a/src/mol-canvas3d/passes/postprocessing.ts +++ b/src/mol-canvas3d/passes/postprocessing.ts @@ -137,17 +137,12 @@ const SsaoSchema = { uProjection: UniformSpec('m4'), uInvProjection: UniformSpec('m4'), - uView: UniformSpec('m4'), uBounds: UniformSpec('v4'), uTexSize: UniformSpec('v2'), uRadius: UniformSpec('f'), uBias: UniformSpec('f'), - - dOrthographic: DefineSpec('number'), - uNear: UniformSpec('f'), - uFar: UniformSpec('f'), }; type SsaoRenderable = ComputeRenderable<Values<typeof SsaoSchema>> @@ -162,17 +157,12 @@ function getSsaoRenderable(ctx: WebGLContext, depthTexture: Texture): SsaoRender uProjection: ValueCell.create(Mat4.identity()), uInvProjection: ValueCell.create(Mat4.identity()), - uView: ValueCell.create(Mat4.identity()), uBounds: ValueCell.create(Vec4()), uTexSize: ValueCell.create(Vec2.create(ctx.gl.drawingBufferWidth, ctx.gl.drawingBufferHeight)), uRadius: ValueCell.create(8.0), uBias: ValueCell.create(0.025), - - dOrthographic: ValueCell.create(0), - uNear: ValueCell.create(0.0), - uFar: ValueCell.create(10000.0), }; const schema = { ...SsaoSchema }; @@ -296,10 +286,6 @@ const PostprocessingSchema = { dOutlineEnable: DefineSpec('boolean'), dOutlineScale: DefineSpec('number'), uOutlineThreshold: UniformSpec('f'), - - dLightCount: DefineSpec('number'), - uLightDirection: UniformSpec('v3[]'), - uLightColor: UniformSpec('v3[]'), }; type PostprocessingRenderable = ComputeRenderable<Values<typeof PostprocessingSchema>> @@ -333,10 +319,6 @@ function getPostprocessingRenderable(ctx: WebGLContext, colorTexture: Texture, d dOutlineEnable: ValueCell.create(false), dOutlineScale: ValueCell.create(1), uOutlineThreshold: ValueCell.create(0.33), - - dLightCount: ValueCell.create(0), - uLightDirection: ValueCell.create([]), - uLightColor: ValueCell.create([]), }; const schema = { ...PostprocessingSchema }; @@ -353,7 +335,7 @@ export const PostprocessingParams = { radius: PD.Numeric(5, { min: 0, max: 10, step: 0.1 }, { description: 'Final occlusion radius is 2^x' }), bias: PD.Numeric(0.8, { min: 0, max: 3, step: 0.1 }), blurKernelSize: PD.Numeric(15, { min: 1, max: 25, step: 2 }), - resolutionScale: PD.Numeric(1, { min: 0.1, max: 1, step: 0.05 }, { description: 'Adjust resolution of occlusion calculation' }) + resolutionScale: PD.Numeric(1, { min: 0.1, max: 1, step: 0.05 }, { description: 'Adjust resolution of occlusion calculation' }), }), off: PD.Group({}) }, { cycle: true, description: 'Darken occluded crevices with the ambient occlusion effect' }), @@ -522,11 +504,6 @@ export class PostprocessingPass { if (props.occlusion.name === 'on') { ValueCell.update(this.ssaoRenderable.values.uProjection, camera.projection); ValueCell.update(this.ssaoRenderable.values.uInvProjection, invProjection); - ValueCell.update(this.ssaoRenderable.values.uView, camera.view); - - ValueCell.updateIfChanged(this.ssaoRenderable.values.uNear, camera.near); - ValueCell.updateIfChanged(this.ssaoRenderable.values.uFar, camera.far); - ValueCell.updateIfChanged(this.ssaoRenderable.values.dOrthographic, orthographic); const [w, h] = this.renderable.values.uTexSize.ref.value; const b = this.ssaoRenderable.values.uBounds; diff --git a/src/mol-gl/renderer.ts b/src/mol-gl/renderer.ts index fdfb4b539b53f4732651bfe13d7778b4ab92850d..c41bf3283e32076853c8e4923fa59702b0364b87 100644 --- a/src/mol-gl/renderer.ts +++ b/src/mol-gl/renderer.ts @@ -127,7 +127,7 @@ export type Light = { const tmpDir = Vec3(); const tmpColor = Vec3(); -export function getLight(props: RendererProps['light'], light?: Light): Light { +function getLight(props: RendererProps['light'], light?: Light): Light { const { direction, color } = light || { direction: (new Array(5 * 3)).fill(0), color: (new Array(5 * 3)).fill(0), diff --git a/src/mol-plugin-ui/structure/quick-styles.tsx b/src/mol-plugin-ui/structure/quick-styles.tsx index 182e53760866b9d3f3257fd9c474bcfd505d11de..e60102ac349fb5b67dcf1867911c80efde6281eb 100644 --- a/src/mol-plugin-ui/structure/quick-styles.tsx +++ b/src/mol-plugin-ui/structure/quick-styles.tsx @@ -62,10 +62,7 @@ export class QuickStyles extends PurePluginUIComponent { name: 'on', params: { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, resolutionScale: 1 } }, - shadow: { - name: 'off', - params: { } - }, + shadow: { name: 'off', params: {} }, } }); } @@ -83,15 +80,12 @@ export class QuickStyles extends PurePluginUIComponent { params: pp.outline.name === 'on' ? pp.outline.params : { scale: 1, color: Color(0x000000), threshold: 0.33 } - } - /* + }, occlusion: { name: 'on', - params: pp.occlusion.name === 'on' - ? pp.occlusion.params - : { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, resolutionScale: 1, shadow: { name: 'off', params: {} }, closeAO: { name: 'off', params: {}} } + params: { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, resolutionScale: 1 } }, - */ + shadow: { name: 'off', params: {} }, } }); }