@@ -14,31 +14,10 @@ import { injectStore } from 'angular-three';
1414import { assertInjector } from 'ngxtension/assert-injector' ;
1515import * 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-
3817export interface NgtsFBOParams {
39- width ?: number | FBOSettings ;
18+ width ?: number | THREE . RenderTargetOptions ;
4019 height ?: number ;
41- settings ?: FBOSettings ;
20+ settings ?: THREE . RenderTargetOptions ;
4221}
4322
4423export 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]' } )
10887export 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 ) ;
0 commit comments