@needle-tools/engine 2.67.11-pre → 2.67.12-pre

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "2.67.11-pre",
3
+ "version": "2.67.12-pre",
4
4
  "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible, and collaboration and XR come naturally.",
5
5
  "main": "dist/needle-engine.umd.cjs",
6
6
  "module": "lib/needle-engine.js",
@@ -1,5 +1,5 @@
1
1
  import { TypeStore } from "./../engine_typestore"
2
-
2
+
3
3
  // Import types
4
4
  import { __Ignore } from "../../engine-components/codegen/components";
5
5
  import { AlignmentConstraint } from "../../engine-components/AlignmentConstraint";
@@ -179,7 +179,7 @@ import { XRGrabModel } from "../../engine-components/WebXRGrabRendering";
179
179
  import { XRGrabRendering } from "../../engine-components/WebXRGrabRendering";
180
180
  import { XRRig } from "../../engine-components/WebXRRig";
181
181
  import { XRState } from "../../engine-components/XRFlag";
182
-
182
+
183
183
  // Register types
184
184
  TypeStore.add("__Ignore", __Ignore);
185
185
  TypeStore.add("AlignmentConstraint", AlignmentConstraint);
@@ -1,5 +1,5 @@
1
1
  import { BlendFunction, DepthDownsamplingPass, Effect, NormalPass, SSAOEffect } from "postprocessing";
2
- import { NeverDepth, PerspectiveCamera } from "three";
2
+ import { Color, NeverDepth, PerspectiveCamera } from "three";
3
3
  import { serializable } from "../../../engine/engine_serialization";
4
4
  import { EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect";
5
5
  import { VolumeParameter } from "../VolumeParameter";
@@ -21,6 +21,12 @@ export class ScreenSpaceAmbientOcclusion extends PostProcessingEffect {
21
21
  @serializable(VolumeParameter)
22
22
  samples!: VolumeParameter;
23
23
 
24
+ @serializable(VolumeParameter)
25
+ color!: VolumeParameter;
26
+
27
+ @serializable(VolumeParameter)
28
+ luminanceInfluence!: VolumeParameter;
29
+
24
30
  onBeforeRender() {
25
31
  if (this._ssao && this.context.mainCamera instanceof PerspectiveCamera) {
26
32
  const fadeDistance = this.context.mainCamera.far - this.context.mainCamera.near;
@@ -48,6 +54,7 @@ export class ScreenSpaceAmbientOcclusion extends PostProcessingEffect {
48
54
  worldProximityFalloff: 2,
49
55
  intensity: 1,
50
56
  blendFunction: BlendFunction.MULTIPLY,
57
+ luminanceInfluence: .5,
51
58
  });
52
59
 
53
60
  this.intensity.onValueChanged = newValue => {
@@ -59,6 +66,13 @@ export class ScreenSpaceAmbientOcclusion extends PostProcessingEffect {
59
66
  this.samples.onValueChanged = newValue => {
60
67
  ssao.samples = newValue;
61
68
  }
69
+ this.color.onValueChanged = newValue => {
70
+ if (!ssao.color) ssao.color = new Color();
71
+ ssao.color.copy(newValue);
72
+ }
73
+ this.luminanceInfluence.onValueChanged = newValue => {
74
+ ssao.luminanceInfluence = newValue;
75
+ }
62
76
 
63
77
  const arr = new Array();
64
78
  arr.push(normalPass);
@@ -193,7 +193,7 @@ export class PostProcessingHandler {
193
193
  }
194
194
 
195
195
 
196
- const effectsOrder: Array<Constructor<Effect | Pass>> = [
196
+ export const effectsOrder: Array<Constructor<Effect | Pass>> = [
197
197
  NormalPass,
198
198
  DepthDownsamplingPass,
199
199
  SSAOEffect,