@@ -14,31 +14,10 @@ import { injectStore } from 'angular-three';
14
14
import { assertInjector } from 'ngxtension/assert-injector' ;
15
15
import * as THREE from 'three' ;
16
16
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
-
38
17
export interface NgtsFBOParams {
39
- width ?: number | FBOSettings ;
18
+ width ?: number | THREE . RenderTargetOptions ;
40
19
height ?: number ;
41
- settings ?: FBOSettings ;
20
+ settings ?: THREE . RenderTargetOptions ;
42
21
}
43
22
44
23
export function fbo ( params : ( ) => NgtsFBOParams = ( ) => ( { } ) , { injector } : { injector ?: Injector } = { } ) {
@@ -57,7 +36,7 @@ export function fbo(params: () => NgtsFBOParams = () => ({}), { injector }: { in
57
36
58
37
const settings = computed ( ( ) => {
59
38
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 ) ) || { } ;
61
40
if ( _settings . samples === undefined ) {
62
41
_settings . samples = 0 ;
63
42
}
@@ -106,7 +85,7 @@ export const injectFBO = fbo;
106
85
107
86
@Directive ( { selector : 'ng-template[fbo]' } )
108
87
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 ) ;
110
89
111
90
private template = inject ( TemplateRef ) ;
112
91
private viewContainerRef = inject ( ViewContainerRef ) ;
0 commit comments