Skip to content

Commit d376f54

Browse files
committed
fix(soba): PixelFormat for fbo
1 parent 1b5ecc9 commit d376f54

File tree

7 files changed

+163
-156
lines changed

7 files changed

+163
-156
lines changed

apps/examples/src/app/soba/aquarium/scene.ts

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,45 +53,47 @@ import { Turtle } from './turtle';
5353
5454
<!-- custom env map -->
5555
<ngts-environment [options]="{ resolution: 1024 }">
56-
<ngt-group * [rotation]="[-Math.PI / 3, 0, 0]">
57-
<ngts-lightformer
58-
[options]="{
59-
intensity: 4,
60-
rotation: [Math.PI / 2, 0, 0],
61-
position: [0, 5, -9],
62-
scale: [10, 10, 1],
63-
}"
64-
/>
65-
66-
@for (x of lightPositions; track $index) {
56+
<ng-template>
57+
<ngt-group [rotation.x]="-Math.PI / 3">
6758
<ngts-lightformer
6859
[options]="{
69-
form: 'circle',
7060
intensity: 4,
7161
rotation: [Math.PI / 2, 0, 0],
72-
position: [x, 4, $index * 4],
73-
scale: [4, 1, 1],
62+
position: [0, 5, -9],
63+
scale: [10, 10, 1],
7464
}"
7565
/>
76-
}
7766
78-
<ngts-lightformer
79-
[options]="{
80-
intensity: 2,
81-
rotation: [Math.PI / 2, 0, 0],
82-
position: [-5, 1, -1],
83-
scale: [50, 2, 1],
84-
}"
85-
/>
86-
<ngts-lightformer
87-
[options]="{
88-
intensity: 2,
89-
rotation: [-Math.PI / 2, 0, 0],
90-
position: [10, 1, 0],
91-
scale: [50, 2, 1],
92-
}"
93-
/>
94-
</ngt-group>
67+
@for (x of lightPositions; track $index) {
68+
<ngts-lightformer
69+
[options]="{
70+
form: 'circle',
71+
intensity: 4,
72+
rotation: [Math.PI / 2, 0, 0],
73+
position: [x, 4, $index * 4],
74+
scale: [4, 1, 1],
75+
}"
76+
/>
77+
}
78+
79+
<ngts-lightformer
80+
[options]="{
81+
intensity: 2,
82+
rotation: [Math.PI / 2, 0, 0],
83+
position: [-5, 1, -1],
84+
scale: [50, 2, 1],
85+
}"
86+
/>
87+
<ngts-lightformer
88+
[options]="{
89+
intensity: 2,
90+
rotation: [-Math.PI / 2, 0, 0],
91+
position: [10, 1, 0],
92+
scale: [50, 2, 1],
93+
}"
94+
/>
95+
</ngt-group>
96+
</ng-template>
9597
</ngts-environment>
9698
9799
<ngts-camera-controls

apps/examples/src/app/soba/camera-scroll/model.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ Command: npx angular-three-gltf&#64;1.1.11 apps/kitchen-sink/src/app/soba/camera
33
**/
44

55
import {
6-
ChangeDetectionStrategy,
7-
Component,
8-
CUSTOM_ELEMENTS_SCHEMA,
9-
effect,
10-
ElementRef,
11-
inject,
12-
signal,
13-
viewChild,
14-
DOCUMENT
6+
ChangeDetectionStrategy,
7+
Component,
8+
CUSTOM_ELEMENTS_SCHEMA,
9+
DOCUMENT,
10+
effect,
11+
ElementRef,
12+
inject,
13+
signal,
14+
viewChild,
1515
} from '@angular/core';
1616
import { beforeRender, NgtArgs, NgtThreeEvent } from 'angular-three';
1717
import { NgtsPerspectiveCamera } from 'angular-three-soba/cameras';
@@ -22,7 +22,6 @@ import { BufferGeometry, Color, Group, MathUtils, Mesh, MeshStandardMaterial } f
2222
import { GLTF } from 'three-stdlib';
2323
import { SCROLL } from './camera-scroll';
2424

25-
2625
import modelUrl from './model-transformed.glb';
2726

2827
type ActionName = 'CameraAction.005';
@@ -117,14 +116,16 @@ export type ModelGLTFResult = GLTF & {
117116
<ngts-perspective-camera
118117
[options]="{ makeDefault: true, far: 100, near: 0.1, fov: 28, rotation: [-Math.PI / 2, 0, 0] }"
119118
>
120-
<ngt-directional-light * [position]="[10, 20, 15]" castShadow [intensity]="Math.PI * 2">
121-
<ngt-value [rawValue]="-0.0001" attach="shadow.bias" />
122-
<ngt-vector2 *args="[1024, 1024]" attach="shadow.mapSize" />
123-
<ngt-value [rawValue]="8" attach="shadow.camera.right" />
124-
<ngt-value [rawValue]="8" attach="shadow.camera.top" />
125-
<ngt-value [rawValue]="-8" attach="shadow.camera.left" />
126-
<ngt-value [rawValue]="-8" attach="shadow.camera.bottom" />
127-
</ngt-directional-light>
119+
<ng-template>
120+
<ngt-directional-light [position]="[10, 20, 15]" castShadow [intensity]="Math.PI * 2">
121+
<ngt-value [rawValue]="-0.0001" attach="shadow.bias" />
122+
<ngt-vector2 *args="[1024, 1024]" attach="shadow.mapSize" />
123+
<ngt-value [rawValue]="8" attach="shadow.camera.right" />
124+
<ngt-value [rawValue]="8" attach="shadow.camera.top" />
125+
<ngt-value [rawValue]="-8" attach="shadow.camera.left" />
126+
<ngt-value [rawValue]="-8" attach="shadow.camera.bottom" />
127+
</ngt-directional-light>
128+
</ng-template>
128129
</ngts-perspective-camera>
129130
</ngt-group>
130131

apps/examples/src/app/soba/epoxy-resin/scene.ts

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -126,48 +126,50 @@ export class TextAndGrid {
126126
/>
127127
128128
<ngts-environment [options]="{ resolution: 32 }">
129-
<ngt-group * [rotation]="[-Math.PI / 4, -0.3, 0]">
130-
<ngts-lightformer
131-
[options]="{
132-
intensity: 20,
133-
rotation: [Math.PI / 2, 0, 0],
134-
position: [0, 5, -9],
135-
scale: [10, 10, 1],
136-
}"
137-
/>
138-
<ngts-lightformer
139-
[options]="{
140-
intensity: 2,
141-
rotation: [Math.PI / 2, 0, 0],
142-
position: [-10, 1, 5],
143-
scale: [10, 10, 1],
144-
}"
145-
/>
146-
<ngts-lightformer
147-
[options]="{
148-
intensity: 2,
149-
rotation: [0, Math.PI / 2, 0],
150-
position: [10, 1, 0],
151-
scale: [10, 10, 1],
152-
}"
153-
/>
154-
<ngts-lightformer
155-
[options]="{
156-
intensity: 2,
157-
rotation: [-Math.PI / 2, 0, 0],
158-
position: [-10, -1, -5],
159-
scale: [10, 10, 1],
160-
}"
161-
/>
162-
<ngts-lightformer
163-
[options]="{
164-
intensity: 2,
165-
rotation: [0, Math.PI / 2, 0],
166-
position: [-5, 1, -1],
167-
scale: [10, 2, 1],
168-
}"
169-
/>
170-
</ngt-group>
129+
<ng-template>
130+
<ngt-group [rotation]="[-Math.PI / 4, -0.3, 0]">
131+
<ngts-lightformer
132+
[options]="{
133+
intensity: 20,
134+
rotation: [Math.PI / 2, 0, 0],
135+
position: [0, 5, -9],
136+
scale: [10, 10, 1],
137+
}"
138+
/>
139+
<ngts-lightformer
140+
[options]="{
141+
intensity: 2,
142+
rotation: [Math.PI / 2, 0, 0],
143+
position: [-10, 1, 5],
144+
scale: [10, 10, 1],
145+
}"
146+
/>
147+
<ngts-lightformer
148+
[options]="{
149+
intensity: 2,
150+
rotation: [0, Math.PI / 2, 0],
151+
position: [10, 1, 0],
152+
scale: [10, 10, 1],
153+
}"
154+
/>
155+
<ngts-lightformer
156+
[options]="{
157+
intensity: 2,
158+
rotation: [-Math.PI / 2, 0, 0],
159+
position: [-10, -1, -5],
160+
scale: [10, 10, 1],
161+
}"
162+
/>
163+
<ngts-lightformer
164+
[options]="{
165+
intensity: 2,
166+
rotation: [0, Math.PI / 2, 0],
167+
position: [-5, 1, -1],
168+
scale: [10, 2, 1],
169+
}"
170+
/>
171+
</ngt-group>
172+
</ng-template>
171173
</ngts-environment>
172174
173175
<ngts-accumulative-shadows

apps/examples/src/app/soba/porsche/porsche.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ gltfResource.preload('./911-transformed.glb');
4848
</ngts-accumulative-shadows>
4949
5050
<ngts-environment [options]="{ background: true, blur: 1, resolution: 256, frames: Infinity }">
51-
<app-lightformers * />
51+
<ng-template>
52+
<app-lightformers />
53+
</ng-template>
5254
</ngts-environment>
5355
5456
<tweakpane-pane title="Porsche">

libs/soba/misc/src/lib/fbo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface FBOSettings {
2525
wrapT?: THREE.Wrapping | undefined;
2626
magFilter?: THREE.MagnificationTextureFilter | undefined;
2727
minFilter?: THREE.MinificationTextureFilter | undefined;
28-
format?: number | undefined; // RGBAFormat;
28+
format?: THREE.PixelFormat | undefined; // RGBAFormat;
2929
type?: THREE.TextureDataType | undefined; // UnsignedByteType;
3030
anisotropy?: number | undefined; // 1;
3131
depthBuffer?: boolean | undefined; // true;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@tweakpane/core": "^2.0.5",
5050
"@types/jest": "29.5.14",
5151
"@types/node": "20.14.12",
52-
"@types/three": "^0.176.0",
52+
"@types/three": "^0.177.0",
5353
"@typescript-eslint/utils": "8.34.0",
5454
"autoprefixer": "^10.4.21",
5555
"cypress": "14.4.1",
@@ -83,7 +83,7 @@
8383
"storybook": "9.0.9",
8484
"storybook-addon-deep-controls": "^0.9.3",
8585
"tailwindcss": "^4.1.10",
86-
"three": "^0.176.0",
86+
"three": "^0.177.0",
8787
"ts-jest": "^29.4.0",
8888
"ts-morph": "^26.0.0",
8989
"ts-node": "10.9.2",

0 commit comments

Comments
 (0)