mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-15 18:14:19 +02:00
performance: NEAREST BufferRenderTarget
This commit is contained in:
@@ -35,6 +35,7 @@ export class DeferredCamera extends Entity {
|
|||||||
height: options.target.height,
|
height: options.target.height,
|
||||||
numBuffers: 4,
|
numBuffers: 4,
|
||||||
name: 'DeferredCamera/cameraTarget',
|
name: 'DeferredCamera/cameraTarget',
|
||||||
|
filter: gl.NEAREST,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
const camera = new PerspectiveCamera( {
|
const camera = new PerspectiveCamera( {
|
||||||
|
@@ -42,10 +42,12 @@ export class GPUParticles extends Entity {
|
|||||||
new BufferRenderTarget( {
|
new BufferRenderTarget( {
|
||||||
...brtOptions,
|
...brtOptions,
|
||||||
name: process.env.DEV && `${ namePrefix }/swap0`,
|
name: process.env.DEV && `${ namePrefix }/swap0`,
|
||||||
|
filter: gl.NEAREST,
|
||||||
} ),
|
} ),
|
||||||
new BufferRenderTarget( {
|
new BufferRenderTarget( {
|
||||||
...brtOptions,
|
...brtOptions,
|
||||||
name: process.env.DEV && `${ namePrefix }/swap1`,
|
name: process.env.DEV && `${ namePrefix }/swap1`,
|
||||||
|
filter: gl.NEAREST,
|
||||||
} ),
|
} ),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ import { RenderTarget } from '../heck/RenderTarget';
|
|||||||
import { Swap } from '@fms-cat/experimental';
|
import { Swap } from '@fms-cat/experimental';
|
||||||
import { auto } from '../globals/automaton';
|
import { auto } from '../globals/automaton';
|
||||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||||
|
import { gl } from '../globals/canvas';
|
||||||
import { quadGeometry } from '../globals/quadGeometry';
|
import { quadGeometry } from '../globals/quadGeometry';
|
||||||
import pixelSorterFrag from '../shaders/pixel-sorter.frag';
|
import pixelSorterFrag from '../shaders/pixel-sorter.frag';
|
||||||
import pixelSorterIndexFrag from '../shaders/pixel-sorter-index.frag';
|
import pixelSorterIndexFrag from '../shaders/pixel-sorter-index.frag';
|
||||||
@@ -38,11 +39,13 @@ export class PixelSorter extends Entity {
|
|||||||
width: options.target.width,
|
width: options.target.width,
|
||||||
height: options.target.height,
|
height: options.target.height,
|
||||||
name: process.env.DEV && 'PixelSorter/swap0',
|
name: process.env.DEV && 'PixelSorter/swap0',
|
||||||
|
filter: gl.NEAREST,
|
||||||
} ),
|
} ),
|
||||||
new BufferRenderTarget( {
|
new BufferRenderTarget( {
|
||||||
width: options.target.width,
|
width: options.target.width,
|
||||||
height: options.target.height,
|
height: options.target.height,
|
||||||
name: process.env.DEV && 'PixelSorter/swap1',
|
name: process.env.DEV && 'PixelSorter/swap1',
|
||||||
|
filter: gl.NEAREST,
|
||||||
} ),
|
} ),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -50,6 +53,7 @@ export class PixelSorter extends Entity {
|
|||||||
width: options.target.width,
|
width: options.target.width,
|
||||||
height: options.target.height,
|
height: options.target.height,
|
||||||
name: process.env.DEV && 'PixelSorter/index',
|
name: process.env.DEV && 'PixelSorter/index',
|
||||||
|
filter: gl.NEAREST,
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// -- bypass -----------------------------------------------------------------------------------
|
// -- bypass -----------------------------------------------------------------------------------
|
||||||
|
@@ -8,6 +8,7 @@ export interface BufferRenderTargetOptions {
|
|||||||
numBuffers?: number;
|
numBuffers?: number;
|
||||||
isFloat?: boolean;
|
isFloat?: boolean;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
filter?: GLenum;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BufferRenderTarget extends RenderTarget {
|
export class BufferRenderTarget extends RenderTarget {
|
||||||
@@ -61,6 +62,10 @@ export class BufferRenderTarget extends RenderTarget {
|
|||||||
this.height = options.height;
|
this.height = options.height;
|
||||||
this.numBuffers = options.numBuffers ?? 1;
|
this.numBuffers = options.numBuffers ?? 1;
|
||||||
|
|
||||||
|
if ( options.filter != null ) {
|
||||||
|
this.texture.textureFilter( options.filter );
|
||||||
|
}
|
||||||
|
|
||||||
if ( process.env.DEV ) {
|
if ( process.env.DEV ) {
|
||||||
this.name = options?.name;
|
this.name = options?.name;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user