angular-three-soba 1.10.0 → 1.11.0

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.
Files changed (62) hide show
  1. package/abstractions/index.d.ts +1 -0
  2. package/abstractions/lib/edges/edges.d.ts +18 -0
  3. package/cameras/index.d.ts +1 -0
  4. package/cameras/lib/camera/camera-content.d.ts +1 -1
  5. package/cameras/lib/cube-camera/cube-camera.d.ts +27 -0
  6. package/esm2020/abstractions/index.mjs +2 -1
  7. package/esm2020/abstractions/lib/edges/edges.mjs +95 -0
  8. package/esm2020/cameras/index.mjs +2 -1
  9. package/esm2020/cameras/lib/camera/camera-content.mjs +1 -1
  10. package/esm2020/cameras/lib/cube-camera/cube-camera.mjs +130 -0
  11. package/esm2020/materials/index.mjs +3 -1
  12. package/esm2020/materials/lib/mesh-refraction-material/mesh-refraction-material.mjs +157 -0
  13. package/esm2020/materials/lib/mesh-transmission-material/mesh-transmission-material.mjs +240 -0
  14. package/esm2020/misc/lib/fbo/fbo.mjs +5 -4
  15. package/esm2020/shaders/index.mjs +5 -1
  16. package/esm2020/shaders/lib/caustics-material/caustics-material.mjs +128 -0
  17. package/esm2020/shaders/lib/caustics-projection-material/caustics-projection-material.mjs +33 -0
  18. package/esm2020/shaders/lib/discard-material/discard-material.mjs +3 -0
  19. package/esm2020/shaders/lib/mesh-transmission-material/mesh-transmission-material.mjs +268 -0
  20. package/esm2020/staging/index.mjs +2 -1
  21. package/esm2020/staging/lib/accumulative-shadows/progressive-light-map.mjs +2 -3
  22. package/esm2020/staging/lib/caustics/caustics.mjs +364 -0
  23. package/fesm2015/angular-three-soba-abstractions.mjs +91 -2
  24. package/fesm2015/angular-three-soba-abstractions.mjs.map +1 -1
  25. package/fesm2015/angular-three-soba-cameras.mjs +127 -4
  26. package/fesm2015/angular-three-soba-cameras.mjs.map +1 -1
  27. package/fesm2015/angular-three-soba-materials.mjs +389 -2
  28. package/fesm2015/angular-three-soba-materials.mjs.map +1 -1
  29. package/fesm2015/angular-three-soba-misc.mjs +4 -3
  30. package/fesm2015/angular-three-soba-misc.mjs.map +1 -1
  31. package/fesm2015/angular-three-soba-shaders.mjs +454 -31
  32. package/fesm2015/angular-three-soba-shaders.mjs.map +1 -1
  33. package/fesm2015/angular-three-soba-staging.mjs +363 -9
  34. package/fesm2015/angular-three-soba-staging.mjs.map +1 -1
  35. package/fesm2020/angular-three-soba-abstractions.mjs +91 -2
  36. package/fesm2020/angular-three-soba-abstractions.mjs.map +1 -1
  37. package/fesm2020/angular-three-soba-cameras.mjs +127 -4
  38. package/fesm2020/angular-three-soba-cameras.mjs.map +1 -1
  39. package/fesm2020/angular-three-soba-materials.mjs +387 -2
  40. package/fesm2020/angular-three-soba-materials.mjs.map +1 -1
  41. package/fesm2020/angular-three-soba-misc.mjs +4 -3
  42. package/fesm2020/angular-three-soba-misc.mjs.map +1 -1
  43. package/fesm2020/angular-three-soba-shaders.mjs +460 -34
  44. package/fesm2020/angular-three-soba-shaders.mjs.map +1 -1
  45. package/fesm2020/angular-three-soba-staging.mjs +362 -9
  46. package/fesm2020/angular-three-soba-staging.mjs.map +1 -1
  47. package/materials/index.d.ts +2 -0
  48. package/materials/lib/mesh-refraction-material/mesh-refraction-material.d.ts +28 -0
  49. package/materials/lib/mesh-transmission-material/mesh-transmission-material.d.ts +47 -0
  50. package/misc/lib/fbo/fbo.d.ts +8 -6
  51. package/package.json +2 -2
  52. package/plugin/package.json +1 -1
  53. package/shaders/index.d.ts +4 -0
  54. package/shaders/lib/caustics-material/caustics-material.d.ts +4 -0
  55. package/shaders/lib/caustics-projection-material/caustics-projection-material.d.ts +4 -0
  56. package/shaders/lib/discard-material/discard-material.d.ts +3 -0
  57. package/shaders/lib/mesh-transmission-material/mesh-transmission-material.d.ts +25 -0
  58. package/staging/index.d.ts +1 -0
  59. package/staging/lib/caustics/caustics.d.ts +48 -0
  60. package/staging/lib/environment/environment-cube.d.ts +1 -1
  61. package/staging/lib/environment/environment-ground.d.ts +1 -1
  62. package/staging/lib/environment/utils.d.ts +1 -1
@@ -1,13 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Directive, Component, CUSTOM_ELEMENTS_SCHEMA, Input, EventEmitter, Output, TemplateRef, ContentChild, ChangeDetectorRef } from '@angular/core';
2
+ import { InjectionToken, inject, Directive, Component, CUSTOM_ELEMENTS_SCHEMA, Input, EventEmitter, Output, ChangeDetectorRef, TemplateRef, ContentChild } from '@angular/core';
3
3
  import { extend, NgtStore, getLocalState, NgtRxStore, injectNgtRef, NgtArgs, NgtRepeat, is, injectBeforeRender, NgtPush, injectNgtDestroy, injectNgtLoader, startWithUndefined, prepare, NgtPortal, NgtPortalContent, createRunInContext, checkUpdate } from 'angular-three';
4
- import { shaderMaterial, SpotLightMaterial } from 'angular-three-soba/shaders';
5
- import { Subject, combineLatest, switchMap, isObservable, of, debounceTime, map, takeUntil, startWith, withLatestFrom } from 'rxjs';
4
+ import { DiscardMaterial, shaderMaterial, CausticsProjectionMaterial, CausticsMaterial, SpotLightMaterial } from 'angular-three-soba/shaders';
5
+ import { Subject, combineLatest, switchMap, map, isObservable, of, debounceTime, takeUntil, startWith, withLatestFrom } from 'rxjs';
6
6
  import * as THREE from 'three';
7
- import { Group, Mesh, PlaneGeometry, DirectionalLight, OrthographicCamera, Vector2, Box3, Vector3, Sphere, MeshStandardMaterial, MeshBasicMaterial, CubeTextureLoader, CubeReflectionMapping, EquirectangularReflectionMapping, sRGBEncoding, LinearEncoding, CubeCamera, HalfFloatType, Points, BufferGeometry, BufferAttribute, Vector4, Color, MathUtils, SpotLight, SpotLightHelper, AmbientLight, PointLight, Spherical, AdditiveBlending } from 'three';
8
- import { SimplexNoise, HorizontalBlurShader, VerticalBlurShader, RGBELoader, GroundProjectedEnv, Sky, FullScreenQuad } from 'three-stdlib';
9
- import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';
10
- import { NgtsBillboard } from 'angular-three-soba/abstractions';
7
+ import { Group, Mesh, PlaneGeometry, DirectionalLight, OrthographicCamera, Vector2, Scene, LineBasicMaterial, Box3, Vector3, Sphere, MeshStandardMaterial, MeshBasicMaterial, CubeTextureLoader, CubeReflectionMapping, EquirectangularReflectionMapping, sRGBEncoding, LinearEncoding, CubeCamera, HalfFloatType, Points, BufferGeometry, BufferAttribute, Vector4, Color, MathUtils, SpotLight, SpotLightHelper, AmbientLight, PointLight, Spherical, AdditiveBlending } from 'three';
8
+ import { SimplexNoise, FullScreenQuad, HorizontalBlurShader, VerticalBlurShader, RGBELoader, GroundProjectedEnv, Sky } from 'three-stdlib';
9
+ import { NgIf, NgFor, NgTemplateOutlet } from '@angular/common';
10
+ import { NgtsEdges, NgtsBillboard } from 'angular-three-soba/abstractions';
11
+ import { injectNgtsFBO } from 'angular-three-soba/misc';
11
12
  import { injectNgtsTextureLoader } from 'angular-three-soba/loaders';
12
13
 
13
14
  function isLight(object) {
@@ -16,7 +17,6 @@ function isLight(object) {
16
17
  function isGeometry(object) {
17
18
  return !!object.geometry;
18
19
  }
19
- const DiscardMaterial = shaderMaterial({}, 'void main() { gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }', 'void main() { discard; }');
20
20
  class ProgressiveLightMap {
21
21
  constructor(renderer, scene, res = 1024) {
22
22
  this.renderer = renderer;
@@ -972,6 +972,360 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
972
972
  type: Input
973
973
  }] } });
974
974
 
975
+ extend({ Group, Scene, Mesh, PlaneGeometry, OrthographicCamera, CausticsProjectionMaterial, LineBasicMaterial });
976
+ const NORMALPROPS = {
977
+ depth: true,
978
+ minFilter: THREE.LinearFilter,
979
+ magFilter: THREE.LinearFilter,
980
+ encoding: THREE.LinearEncoding,
981
+ type: THREE.UnsignedByteType,
982
+ };
983
+ const CAUSTICPROPS = {
984
+ minFilter: THREE.LinearMipmapLinearFilter,
985
+ magFilter: THREE.LinearFilter,
986
+ encoding: THREE.LinearEncoding,
987
+ format: THREE.RGBAFormat,
988
+ type: THREE.FloatType,
989
+ generateMipmaps: true,
990
+ };
991
+ function createNormalMaterial(side = THREE.FrontSide) {
992
+ const viewMatrix = { value: new THREE.Matrix4() };
993
+ return Object.assign(new THREE.MeshNormalMaterial({ side }), {
994
+ viewMatrix,
995
+ onBeforeCompile: (shader) => {
996
+ shader.uniforms.viewMatrix = viewMatrix;
997
+ shader.fragmentShader =
998
+ `vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
999
+ return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
1000
+ }\n` +
1001
+ shader.fragmentShader.replace('#include <normal_fragment_maps>', `#include <normal_fragment_maps>
1002
+ normal = inverseTransformDirection( normal, viewMatrix );\n`);
1003
+ },
1004
+ });
1005
+ }
1006
+ class NgtsCaustics extends NgtRxStore {
1007
+ constructor() {
1008
+ super(...arguments);
1009
+ this.CustomBlending = THREE.CustomBlending;
1010
+ this.OneFactor = THREE.OneFactor;
1011
+ this.SrcAlphaFactor = THREE.SrcAlphaFactor;
1012
+ this.Math = Math;
1013
+ this.planeRef = injectNgtRef();
1014
+ this.sceneRef = injectNgtRef();
1015
+ this.cameraRef = injectNgtRef();
1016
+ this.causticsRef = injectNgtRef();
1017
+ this.normalTargetFbo = injectNgtsFBO(() => this.select('resolution').pipe(map((resolution) => ({ width: resolution, height: resolution, settings: NORMALPROPS }))));
1018
+ this.normalTargetBFbo = injectNgtsFBO(() => this.select('resolution').pipe(map((resolution) => ({ width: resolution, height: resolution, settings: NORMALPROPS }))));
1019
+ this.causticsTargetFbo = injectNgtsFBO(() => this.select('resolution').pipe(map((resolution) => ({ width: resolution, height: resolution, settings: CAUSTICPROPS }))));
1020
+ this.causticsTargetBFbo = injectNgtsFBO(() => this.select('resolution').pipe(map((resolution) => ({ width: resolution, height: resolution, settings: CAUSTICPROPS }))));
1021
+ this.store = inject(NgtStore);
1022
+ this.cdr = inject(ChangeDetectorRef);
1023
+ }
1024
+ /** How many frames it will render, set it to Infinity for runtime, default: 1 */
1025
+ set frames(frames) {
1026
+ this.set({ frames });
1027
+ }
1028
+ /** Enables visual cues to help you stage your scene, default: false */
1029
+ set debug(debug) {
1030
+ this.set({ debug });
1031
+ }
1032
+ /** Will display caustics only and skip the models, default: false */
1033
+ set causticsOnly(causticsOnly) {
1034
+ this.set({ causticsOnly });
1035
+ }
1036
+ /** Will include back faces and enable the backsideIOR prop, default: false */
1037
+ set backside(backside) {
1038
+ this.set({ backside });
1039
+ }
1040
+ /** The IOR refraction index, default: 1.1 */
1041
+ set ior(ior) {
1042
+ this.set({ ior });
1043
+ }
1044
+ /** The IOR refraction index for back faces (only available when backside is enabled), default: 1.1 */
1045
+ set backsideIOR(backsideIOR) {
1046
+ this.set({ backsideIOR });
1047
+ }
1048
+ /** The texel size, default: 0.3125 */
1049
+ set worldRadius(worldRadius) {
1050
+ this.set({ worldRadius });
1051
+ }
1052
+ /** Intensity of the prjected caustics, default: 0.05 */
1053
+ set intensity(intensity) {
1054
+ this.set({ intensity });
1055
+ }
1056
+ /** Caustics color, default: white */
1057
+ set color(color) {
1058
+ this.set({ color });
1059
+ }
1060
+ /** Buffer resolution, default: 2048 */
1061
+ set resolution(resolution) {
1062
+ this.set({ resolution });
1063
+ }
1064
+ /** Camera position, it will point towards the contents bounds center, default: [5, 5, 5] */
1065
+ set lightSource(lightSource) {
1066
+ this.set({ lightSource });
1067
+ }
1068
+ initialize() {
1069
+ this.set({
1070
+ frames: 1,
1071
+ ior: 1.1,
1072
+ color: 'white',
1073
+ causticsOnly: false,
1074
+ backside: false,
1075
+ backsideIOR: 1.1,
1076
+ worldRadius: 0.3125,
1077
+ intensity: 0.05,
1078
+ resolution: 2024,
1079
+ lightSource: [5, 5, 5],
1080
+ });
1081
+ }
1082
+ ngOnInit() {
1083
+ this.updateWorldMatrix();
1084
+ this.setBeforeRender();
1085
+ }
1086
+ updateWorldMatrix() {
1087
+ this.hold(combineLatest([this.sceneRef.children$(), this.causticsRef.$, this.causticsRef.children$(), this.select()]), () => {
1088
+ if (this.causticsRef.nativeElement) {
1089
+ this.causticsRef.nativeElement.updateWorldMatrix(false, true);
1090
+ }
1091
+ });
1092
+ }
1093
+ setBeforeRender() {
1094
+ const causticsMaterial = new CausticsMaterial();
1095
+ const causticsQuad = new FullScreenQuad(causticsMaterial);
1096
+ const normalMaterial = createNormalMaterial();
1097
+ const normalMaterialB = createNormalMaterial(THREE.BackSide);
1098
+ this.effect(combineLatest([
1099
+ this.sceneRef.$,
1100
+ this.sceneRef.children$('both'),
1101
+ this.causticsRef.$,
1102
+ this.cameraRef.$,
1103
+ this.planeRef.$,
1104
+ this.planeRef.children$('both'),
1105
+ this.normalTargetFbo.$,
1106
+ this.normalTargetBFbo.$,
1107
+ this.causticsTargetFbo.$,
1108
+ this.causticsTargetBFbo.$,
1109
+ ]), ([scene, children, caustics, camera, plane, , normalTarget, normalTargetB, causticsTarget, causticsTargetB,]) => {
1110
+ const v = new THREE.Vector3();
1111
+ const lpF = new THREE.Frustum();
1112
+ const lpM = new THREE.Matrix4();
1113
+ const lpP = new THREE.Plane();
1114
+ const lightDir = new THREE.Vector3();
1115
+ const lightDirInv = new THREE.Vector3();
1116
+ const bounds = new THREE.Box3();
1117
+ const focusPos = new THREE.Vector3();
1118
+ let count = 0;
1119
+ caustics.updateWorldMatrix(false, true);
1120
+ if (children.length > 1) {
1121
+ return this.store.get('internal').subscribe(({ gl }) => {
1122
+ var _a;
1123
+ const { frames, lightSource, resolution, worldRadius, intensity, backside, backsideIOR, ior, causticsOnly, debug, } = this.get();
1124
+ if (frames === Infinity || count++ < frames) {
1125
+ if (Array.isArray(lightSource))
1126
+ lightDir.fromArray(lightSource).normalize();
1127
+ else
1128
+ lightDir.copy(caustics.worldToLocal(lightSource.nativeElement.getWorldPosition(v)).normalize());
1129
+ lightDirInv.copy(lightDir).multiplyScalar(-1);
1130
+ let boundsVertices = [];
1131
+ (_a = scene.parent) === null || _a === void 0 ? void 0 : _a.matrixWorld.identity();
1132
+ bounds.setFromObject(scene, true);
1133
+ boundsVertices.push(new THREE.Vector3(bounds.min.x, bounds.min.y, bounds.min.z));
1134
+ boundsVertices.push(new THREE.Vector3(bounds.min.x, bounds.min.y, bounds.max.z));
1135
+ boundsVertices.push(new THREE.Vector3(bounds.min.x, bounds.max.y, bounds.min.z));
1136
+ boundsVertices.push(new THREE.Vector3(bounds.min.x, bounds.max.y, bounds.max.z));
1137
+ boundsVertices.push(new THREE.Vector3(bounds.max.x, bounds.min.y, bounds.min.z));
1138
+ boundsVertices.push(new THREE.Vector3(bounds.max.x, bounds.min.y, bounds.max.z));
1139
+ boundsVertices.push(new THREE.Vector3(bounds.max.x, bounds.max.y, bounds.min.z));
1140
+ boundsVertices.push(new THREE.Vector3(bounds.max.x, bounds.max.y, bounds.max.z));
1141
+ const worldVerts = boundsVertices.map((v) => v.clone());
1142
+ bounds.getCenter(focusPos);
1143
+ boundsVertices = boundsVertices.map((v) => v.clone().sub(focusPos));
1144
+ const lightPlane = lpP.set(lightDirInv, 0);
1145
+ const projectedVerts = boundsVertices.map((v) => lightPlane.projectPoint(v, new THREE.Vector3()));
1146
+ const centralVert = projectedVerts
1147
+ .reduce((a, b) => a.add(b), v.set(0, 0, 0))
1148
+ .divideScalar(projectedVerts.length);
1149
+ const radius = projectedVerts
1150
+ .map((v) => v.distanceTo(centralVert))
1151
+ .reduce((a, b) => Math.max(a, b));
1152
+ const dirLength = boundsVertices
1153
+ .map((x) => x.dot(lightDir))
1154
+ .reduce((a, b) => Math.max(a, b));
1155
+ // Shadows
1156
+ camera.position.copy(lightDir.clone().multiplyScalar(dirLength).add(focusPos));
1157
+ camera.lookAt(scene.localToWorld(focusPos.clone()));
1158
+ const dirMatrix = lpM.lookAt(camera.position, focusPos, v.set(0, 1, 0));
1159
+ camera.left = -radius;
1160
+ camera.right = radius;
1161
+ camera.top = radius;
1162
+ camera.bottom = -radius;
1163
+ const yOffset = v.set(0, radius, 0).applyMatrix4(dirMatrix);
1164
+ const yTime = (camera.position.y + yOffset.y) / lightDir.y;
1165
+ camera.near = 0.1;
1166
+ camera.far = yTime;
1167
+ camera.updateProjectionMatrix();
1168
+ camera.updateMatrixWorld();
1169
+ // Now find size of ground plane
1170
+ const groundProjectedCoords = worldVerts.map((v) => v.add(lightDir.clone().multiplyScalar(-v.y / lightDir.y)));
1171
+ const centerPos = groundProjectedCoords
1172
+ .reduce((a, b) => a.add(b), v.set(0, 0, 0))
1173
+ .divideScalar(groundProjectedCoords.length);
1174
+ const maxSize = 2 *
1175
+ groundProjectedCoords
1176
+ .map((v) => Math.hypot(v.x - centerPos.x, v.z - centerPos.z))
1177
+ .reduce((a, b) => Math.max(a, b));
1178
+ plane.scale.setScalar(maxSize);
1179
+ plane.position.copy(centerPos);
1180
+ // if (debug) helper.current?.update();
1181
+ // Inject uniforms
1182
+ normalMaterialB.viewMatrix.value = normalMaterial.viewMatrix.value =
1183
+ camera.matrixWorldInverse;
1184
+ const dirLightNearPlane = lpF.setFromProjectionMatrix(lpM.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse)).planes[4];
1185
+ causticsMaterial.cameraMatrixWorld = camera.matrixWorld;
1186
+ causticsMaterial.cameraProjectionMatrixInv = camera.projectionMatrixInverse;
1187
+ causticsMaterial.lightDir = lightDirInv;
1188
+ causticsMaterial.lightPlaneNormal = dirLightNearPlane.normal;
1189
+ causticsMaterial.lightPlaneConstant = dirLightNearPlane.constant;
1190
+ causticsMaterial.near = camera.near;
1191
+ causticsMaterial.far = camera.far;
1192
+ causticsMaterial.resolution = resolution;
1193
+ causticsMaterial.size = radius;
1194
+ causticsMaterial.intensity = intensity;
1195
+ causticsMaterial.worldRadius = worldRadius;
1196
+ // Switch the scene on
1197
+ scene.visible = true;
1198
+ // Render front face normals
1199
+ gl.setRenderTarget(normalTarget);
1200
+ gl.clear();
1201
+ scene.overrideMaterial = normalMaterial;
1202
+ gl.render(scene, camera);
1203
+ // Render back face normals, if enabled
1204
+ gl.setRenderTarget(normalTargetB);
1205
+ gl.clear();
1206
+ if (backside) {
1207
+ scene.overrideMaterial = normalMaterialB;
1208
+ gl.render(scene, camera);
1209
+ }
1210
+ // Remove the override material
1211
+ scene.overrideMaterial = null;
1212
+ // Render front face caustics
1213
+ causticsMaterial.ior = ior;
1214
+ // @ts-ignore
1215
+ plane.material.lightProjMatrix = camera.projectionMatrix;
1216
+ // @ts-ignore
1217
+ plane.material.lightViewMatrix = camera.matrixWorldInverse;
1218
+ causticsMaterial.normalTexture = normalTarget.texture;
1219
+ causticsMaterial.depthTexture = normalTarget.depthTexture;
1220
+ gl.setRenderTarget(causticsTarget);
1221
+ gl.clear();
1222
+ causticsQuad.render(gl);
1223
+ // Render back face caustics, if enabled
1224
+ causticsMaterial.ior = backsideIOR;
1225
+ causticsMaterial.normalTexture = normalTargetB.texture;
1226
+ causticsMaterial.depthTexture = normalTargetB.depthTexture;
1227
+ gl.setRenderTarget(causticsTargetB);
1228
+ gl.clear();
1229
+ if (backside)
1230
+ causticsQuad.render(gl);
1231
+ // Reset render target
1232
+ gl.setRenderTarget(null);
1233
+ // Switch the scene off if caustics is all that's wanted
1234
+ if (causticsOnly)
1235
+ scene.visible = false;
1236
+ }
1237
+ });
1238
+ }
1239
+ });
1240
+ }
1241
+ }
1242
+ NgtsCaustics.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: NgtsCaustics, deps: null, target: i0.ɵɵFactoryTarget.Component });
1243
+ NgtsCaustics.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0", type: NgtsCaustics, isStandalone: true, selector: "ngts-caustics", inputs: { causticsRef: "causticsRef", frames: "frames", debug: "debug", causticsOnly: "causticsOnly", backside: "backside", ior: "ior", backsideIOR: "backsideIOR", worldRadius: "worldRadius", intensity: "intensity", color: "color", resolution: "resolution", lightSource: "lightSource" }, usesInheritance: true, ngImport: i0, template: `
1244
+ <ngt-group [ref]="causticsRef" ngtCompound>
1245
+ <ngt-scene [ref]="sceneRef">
1246
+ <ngt-orthographic-camera [ref]="cameraRef" [up]="[0, 1, 0]" />
1247
+ <ng-content />
1248
+ </ngt-scene>
1249
+ <ngt-mesh [renderOrder]="2" [ref]="planeRef" [rotation]="[-Math.PI / 2, 0, 0]">
1250
+ <ngt-plane-geometry />
1251
+ <ngt-caustics-projection-material
1252
+ *ngIf="causticsTargetFbo.nativeElement && causticsTargetBFbo.nativeElement"
1253
+ [transparent]="true"
1254
+ [color]="get('color')"
1255
+ [causticsTexture]="causticsTargetFbo.nativeElement.texture"
1256
+ [causticsTextureB]="causticsTargetBFbo.nativeElement.texture"
1257
+ [blending]="CustomBlending"
1258
+ [blendSrc]="OneFactor"
1259
+ [blendDst]="SrcAlphaFactor"
1260
+ [depthWrite]="false"
1261
+ />
1262
+
1263
+ <ngts-edges *ngIf="get('debug')" [withChildren]="true">
1264
+ <ngt-line-basic-material color="#ffff00" [toneMapped]="false" />
1265
+ </ngts-edges>
1266
+ </ngt-mesh>
1267
+ </ngt-group>
1268
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgtsEdges, selector: "ngts-edges", inputs: ["edgesRef", "threshold", "color", "geometry", "userData", "withChildren"] }] });
1269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: NgtsCaustics, decorators: [{
1270
+ type: Component,
1271
+ args: [{
1272
+ selector: 'ngts-caustics',
1273
+ standalone: true,
1274
+ template: `
1275
+ <ngt-group [ref]="causticsRef" ngtCompound>
1276
+ <ngt-scene [ref]="sceneRef">
1277
+ <ngt-orthographic-camera [ref]="cameraRef" [up]="[0, 1, 0]" />
1278
+ <ng-content />
1279
+ </ngt-scene>
1280
+ <ngt-mesh [renderOrder]="2" [ref]="planeRef" [rotation]="[-Math.PI / 2, 0, 0]">
1281
+ <ngt-plane-geometry />
1282
+ <ngt-caustics-projection-material
1283
+ *ngIf="causticsTargetFbo.nativeElement && causticsTargetBFbo.nativeElement"
1284
+ [transparent]="true"
1285
+ [color]="get('color')"
1286
+ [causticsTexture]="causticsTargetFbo.nativeElement.texture"
1287
+ [causticsTextureB]="causticsTargetBFbo.nativeElement.texture"
1288
+ [blending]="CustomBlending"
1289
+ [blendSrc]="OneFactor"
1290
+ [blendDst]="SrcAlphaFactor"
1291
+ [depthWrite]="false"
1292
+ />
1293
+
1294
+ <ngts-edges *ngIf="get('debug')" [withChildren]="true">
1295
+ <ngt-line-basic-material color="#ffff00" [toneMapped]="false" />
1296
+ </ngts-edges>
1297
+ </ngt-mesh>
1298
+ </ngt-group>
1299
+ `,
1300
+ imports: [NgIf, NgtsEdges],
1301
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
1302
+ }]
1303
+ }], propDecorators: { causticsRef: [{
1304
+ type: Input
1305
+ }], frames: [{
1306
+ type: Input
1307
+ }], debug: [{
1308
+ type: Input
1309
+ }], causticsOnly: [{
1310
+ type: Input
1311
+ }], backside: [{
1312
+ type: Input
1313
+ }], ior: [{
1314
+ type: Input
1315
+ }], backsideIOR: [{
1316
+ type: Input
1317
+ }], worldRadius: [{
1318
+ type: Input
1319
+ }], intensity: [{
1320
+ type: Input
1321
+ }], color: [{
1322
+ type: Input
1323
+ }], resolution: [{
1324
+ type: Input
1325
+ }], lightSource: [{
1326
+ type: Input
1327
+ }] } });
1328
+
975
1329
  extend({ Group });
976
1330
  class NgtsCenter extends NgtRxStore {
977
1331
  constructor() {
@@ -3478,5 +3832,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
3478
3832
  * Generated bundle index. Do not edit.
3479
3833
  */
3480
3834
 
3481
- export { NGTS_BOUNDS_API, NGTS_SPOT_LIGHT_API, NgtsAccumulativeShadows, NgtsBounds, NgtsCameraShake, NgtsCenter, NgtsCloud, NgtsContactShadows, NgtsEnvironment, NgtsEnvironmentContent, NgtsFloat, NgtsRandomizedLights, NgtsSky, NgtsSparkles, NgtsSpotLight, NgtsSpotLightShadow, NgtsStage, NgtsStageRefit, NgtsStars, calcPosFromAngles, ngtsEnvironmentPresetsObj };
3835
+ export { NGTS_BOUNDS_API, NGTS_SPOT_LIGHT_API, NgtsAccumulativeShadows, NgtsBounds, NgtsCameraShake, NgtsCaustics, NgtsCenter, NgtsCloud, NgtsContactShadows, NgtsEnvironment, NgtsEnvironmentContent, NgtsFloat, NgtsRandomizedLights, NgtsSky, NgtsSparkles, NgtsSpotLight, NgtsSpotLightShadow, NgtsStage, NgtsStageRefit, NgtsStars, calcPosFromAngles, ngtsEnvironmentPresetsObj };
3482
3836
  //# sourceMappingURL=angular-three-soba-staging.mjs.map