@needle-tools/engine 4.7.0-next.2756168 → 4.7.0-next.85b31db

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,13 @@
1
1
  import { MODULES } from "../../../engine/engine_modules.js";
2
2
  import { serializable } from "../../../engine/engine_serialization.js";
3
+ import { getParam } from "../../../engine/engine_utils.js";
3
4
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
4
5
  import { VolumeParameter } from "../VolumeParameter.js";
5
6
  import { registerCustomEffectType } from "../VolumeProfile.js";
6
7
 
7
8
 
9
+ const debug = getParam("debugpost");
10
+
8
11
 
9
12
  export enum QualityLevel {
10
13
  LOW = 0,
@@ -32,15 +35,19 @@ export class Antialiasing extends PostProcessingEffect {
32
35
 
33
36
  onCreateEffect(): EffectProviderResult {
34
37
  const effect = new MODULES.POSTPROCESSING.MODULE.SMAAEffect({
35
- preset: MODULES.POSTPROCESSING.MODULE.SMAAPreset.HIGH,
38
+ preset: this.preset?.value ?? MODULES.POSTPROCESSING.MODULE.SMAAPreset.HIGH,
36
39
  edgeDetectionMode: MODULES.POSTPROCESSING.MODULE.EdgeDetectionMode.LUMA,
37
40
  // Keep predication mode disabled (default) since it looks better
38
41
  // predicationMode: MODULES.POSTPROCESSING.MODULE.PredicationMode.DEPTH,
39
42
  });
40
43
 
41
44
  this.preset.onValueChanged = (newValue) => {
45
+ if(debug) console.log("Antialiasing preset changed to", newValue);
42
46
  effect.applyPreset(newValue);
43
47
  };
48
+ // setInterval(()=> {
49
+ // effect.applyPreset(Math.floor(Math.random()*3))
50
+ // }, 1000)
44
51
 
45
52
  // effect.edgeDetectionMaterial.edgeDetectionThreshold = .01;
46
53
 
@@ -124,7 +124,7 @@ export class ScreenSpaceAmbientOcclusionN8 extends PostProcessingEffect {
124
124
  cam,
125
125
  width, height
126
126
  ) as N8AOPostPass;
127
- ssao.name = "SSAO N8";
127
+ ssao.name = "SSAO_N8";
128
128
 
129
129
  const mode = ScreenSpaceAmbientOcclusionN8QualityMode[this.quality];
130
130
  ssao.setQualityMode(mode);
@@ -183,7 +183,7 @@ export class PostProcessingHandler {
183
183
  });
184
184
  }
185
185
 
186
- function validateEffect(source:string, effect: Effect | Pass): boolean {
186
+ function validateEffect(source: string, effect: Effect | Pass): boolean {
187
187
  if (!effect) {
188
188
  return false;
189
189
  }
@@ -461,7 +461,6 @@ export class PostProcessingHandler {
461
461
  }
462
462
  foundEnabled = true;
463
463
  }
464
-
465
464
  pass.renderToScreen = renderToScreen;
466
465
 
467
466
  if ((pass as any)?.configuration !== undefined) {
@@ -194,7 +194,7 @@ export class Volume extends Behaviour implements IEditorModificationReceiver, IP
194
194
  if (this._postprocessing.multisampling !== 0) {
195
195
  this._postprocessing.multisampling = 0;
196
196
  if (debug || isDevEnvironment()) {
197
- console.warn(`[PostProcessing] Disabling multisampling you're using SMAA and have set the 'multisampling: auto' on your PostprocessingManager/Volume component. If you need anti-aliasing, consider adding an Antialiasing component or SMAA effect to the PostprocessingManager.`);
197
+ console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.\n\nIf you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`);
198
198
  }
199
199
  }
200
200
  }