Skip to main content
Sign in
Snippets Groups Projects
Commit c5f9eb54 authored by Alexander Rose's avatar Alexander Rose
Browse files

set default occlusion scaleFactor to 1

parent aebbfeb0
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ function occlusionStyle(plugin: PluginContext) { ...@@ -48,7 +48,7 @@ function occlusionStyle(plugin: PluginContext) {
blurKernelSize: 15, blurKernelSize: 15,
radius: 5, radius: 5,
samples: 32, samples: 32,
scaleFactor: 0.5 scaleFactor: 1
} }, } },
outline: { name: 'on', params: { outline: { name: 'on', params: {
scale: 1.0, scale: 1.0,
... ...
......
...@@ -24,7 +24,7 @@ const Canvas3DPresets = { ...@@ -24,7 +24,7 @@ const Canvas3DPresets = {
illustrative: { illustrative: {
canvas3d: <Preset>{ canvas3d: <Preset>{
postprocessing: { postprocessing: {
occlusion: { name: 'on', params: { samples: 32, radius: 6, bias: 1.4, blurKernelSize: 15, scaleFactor: 0.5 } }, occlusion: { name: 'on', params: { samples: 32, radius: 6, bias: 1.4, blurKernelSize: 15, scaleFactor: 1 } },
outline: { name: 'on', params: { scale: 1, threshold: 0.33, color: Color(0x000000) } } outline: { name: 'on', params: { scale: 1, threshold: 0.33, color: Color(0x000000) } }
}, },
renderer: { renderer: {
...@@ -36,7 +36,7 @@ const Canvas3DPresets = { ...@@ -36,7 +36,7 @@ const Canvas3DPresets = {
occlusion: { occlusion: {
canvas3d: <Preset>{ canvas3d: <Preset>{
postprocessing: { postprocessing: {
occlusion: { name: 'on', params: { samples: 32, radius: 6, bias: 1.4, blurKernelSize: 15, scaleFactor: 0.5 } }, occlusion: { name: 'on', params: { samples: 32, radius: 6, bias: 1.4, blurKernelSize: 15, scaleFactor: 1 } },
outline: { name: 'off', params: {} } outline: { name: 'off', params: {} }
}, },
renderer: { renderer: {
... ...
......
...@@ -249,7 +249,7 @@ export const PostprocessingParams = { ...@@ -249,7 +249,7 @@ export const PostprocessingParams = {
radius: PD.Numeric(5, { min: 0, max: 10, step: 0.1 }, { description: 'Final occlusion radius is 2^x' }), 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 }), bias: PD.Numeric(0.8, { min: 0, max: 3, step: 0.1 }),
blurKernelSize: PD.Numeric(15, { min: 1, max: 25, step: 2 }), blurKernelSize: PD.Numeric(15, { min: 1, max: 25, step: 2 }),
scaleFactor: PD.Numeric(0.5, { min: 0.1, max: 1, step: 0.05 }, { description: 'Adjust resolution of occlusion calculation' }), scaleFactor: PD.Numeric(1, { min: 0.1, max: 1, step: 0.05 }, { description: 'Adjust resolution of occlusion calculation' }),
}), }),
off: PD.Group({}) off: PD.Group({})
}, { cycle: true, description: 'Darken occluded crevices with the ambient occlusion effect' }), }, { cycle: true, description: 'Darken occluded crevices with the ambient occlusion effect' }),
...@@ -313,7 +313,7 @@ export class PostprocessingPass { ...@@ -313,7 +313,7 @@ export class PostprocessingPass {
this.nSamples = 1; this.nSamples = 1;
this.blurKernelSize = 1; this.blurKernelSize = 1;
this.downsampleFactor = 0.5; this.downsampleFactor = 1;
this.ssaoScale = this.calcSsaoScale(); this.ssaoScale = this.calcSsaoScale();
// needs to be linear for anti-aliasing pass // needs to be linear for anti-aliasing pass
...@@ -352,7 +352,7 @@ export class PostprocessingPass { ...@@ -352,7 +352,7 @@ export class PostprocessingPass {
this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0'); this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0');
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampledDepthTarget.texture); this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ? depthTexture : this.downsampledDepthTarget.texture);
this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal'); this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal');
this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical'); this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical');
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTexture, this.outlinesTarget.texture, this.ssaoDepthTexture); this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTexture, this.outlinesTarget.texture, this.ssaoDepthTexture);
...@@ -530,7 +530,7 @@ export class PostprocessingPass { ...@@ -530,7 +530,7 @@ export class PostprocessingPass {
gl.scissor(x, y, width, height); gl.scissor(x, y, width, height);
} }
occlusionOffset: [x: number, y: number] = [0, 0]; private occlusionOffset: [x: number, y: number] = [0, 0];
setOcclusionOffset(x: number, y: number) { setOcclusionOffset(x: number, y: number) {
this.occlusionOffset[0] = x; this.occlusionOffset[0] = x;
this.occlusionOffset[1] = y; this.occlusionOffset[1] = y;
... ...
......
...@@ -60,7 +60,7 @@ export class QuickStyles extends PurePluginUIComponent { ...@@ -60,7 +60,7 @@ export class QuickStyles extends PurePluginUIComponent {
}, },
occlusion: { occlusion: {
name: 'on', name: 'on',
params: { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, scaleFactor: 0.5 } params: { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, scaleFactor: 1 }
}, },
} }
}); });
...@@ -84,7 +84,7 @@ export class QuickStyles extends PurePluginUIComponent { ...@@ -84,7 +84,7 @@ export class QuickStyles extends PurePluginUIComponent {
name: 'on', name: 'on',
params: pp.occlusion.name === 'on' params: pp.occlusion.name === 'on'
? pp.occlusion.params ? pp.occlusion.params
: { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, scaleFactor: 0.5 } : { bias: 0.8, blurKernelSize: 15, radius: 5, samples: 32, scaleFactor: 1 }
}, },
} }
}); });
... ...
......
...@@ -143,7 +143,7 @@ class ViewportScreenshotHelper extends PluginComponent { ...@@ -143,7 +143,7 @@ class ViewportScreenshotHelper extends PluginComponent {
postprocessing: { postprocessing: {
...c.props.postprocessing, ...c.props.postprocessing,
occlusion: aoProps.name === 'on' occlusion: aoProps.name === 'on'
? { name: 'on', params: { ...aoProps.params, samples: 128 } } ? { name: 'on', params: { ...aoProps.params, samples: 128, scaleFactor: 1 } }
: aoProps : aoProps
}, },
marking: { ...c.props.marking } marking: { ...c.props.marking }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment