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