Skip to content

Commit 3f2d575

Browse files
committed
fix(soba): adjust fbo types
1 parent da57c2f commit 3f2d575

File tree

2 files changed

+5
-26
lines changed

2 files changed

+5
-26
lines changed

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

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,10 @@ import { injectStore } from 'angular-three';
1414
import { assertInjector } from 'ngxtension/assert-injector';
1515
import * as THREE from 'three';
1616

17-
interface FBOSettings {
18-
/** Defines the count of MSAA samples. Can only be used with WebGL 2. Default: 0 */
19-
samples?: number;
20-
/** If set, the scene depth will be rendered into buffer.depthTexture. Default: false */
21-
depth?: boolean;
22-
23-
// WebGLRenderTargetOptions => RenderTargetOptions
24-
wrapS?: THREE.Wrapping | undefined;
25-
wrapT?: THREE.Wrapping | undefined;
26-
magFilter?: THREE.MagnificationTextureFilter | undefined;
27-
minFilter?: THREE.MinificationTextureFilter | undefined;
28-
format?: THREE.PixelFormat | undefined; // RGBAFormat;
29-
type?: THREE.TextureDataType | undefined; // UnsignedByteType;
30-
anisotropy?: number | undefined; // 1;
31-
depthBuffer?: boolean | undefined; // true;
32-
stencilBuffer?: boolean | undefined; // false;
33-
generateMipmaps?: boolean | undefined; // true;
34-
depthTexture?: THREE.DepthTexture | undefined;
35-
colorSpace?: THREE.ColorSpace | undefined;
36-
}
37-
3817
export interface NgtsFBOParams {
39-
width?: number | FBOSettings;
18+
width?: number | THREE.RenderTargetOptions;
4019
height?: number;
41-
settings?: FBOSettings;
20+
settings?: THREE.RenderTargetOptions;
4221
}
4322

4423
export function fbo(params: () => NgtsFBOParams = () => ({}), { injector }: { injector?: Injector } = {}) {
@@ -57,7 +36,7 @@ export function fbo(params: () => NgtsFBOParams = () => ({}), { injector }: { in
5736

5837
const settings = computed(() => {
5938
const { width, settings } = params();
60-
const _settings = (typeof width === 'number' ? settings : (width as FBOSettings)) || {};
39+
const _settings = (typeof width === 'number' ? settings : (width as THREE.RenderTargetOptions)) || {};
6140
if (_settings.samples === undefined) {
6241
_settings.samples = 0;
6342
}
@@ -106,7 +85,7 @@ export const injectFBO = fbo;
10685

10786
@Directive({ selector: 'ng-template[fbo]' })
10887
export class NgtsFBO {
109-
fbo = input({} as { width: NgtsFBOParams['width']; height: NgtsFBOParams['height'] } & FBOSettings);
88+
fbo = input({} as { width: NgtsFBOParams['width']; height: NgtsFBOParams['height'] } & THREE.RenderTargetOptions);
11089

11190
private template = inject(TemplateRef);
11291
private viewContainerRef = inject(ViewContainerRef);

libs/soba/staging/src/lib/caustics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import * as THREE from 'three';
1717
import { Group, LineBasicMaterial, Mesh, OrthographicCamera, PlaneGeometry, Scene } from 'three';
1818

1919
const NORMAL_OPTIONS = {
20-
depth: true,
20+
depthBuffer: true,
2121
minFilter: THREE.LinearFilter,
2222
magFilter: THREE.LinearFilter,
2323
type: THREE.UnsignedByteType,

0 commit comments

Comments
 (0)