mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-13 17:24:00 +02:00
performance: fix particles stall
This commit is contained in:
@@ -2,7 +2,7 @@ import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers, dummyRenderTargetTwoDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { genOctahedron } from '../geometries/genOctahedron';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
@@ -24,7 +24,7 @@ export class SphereParticles extends Entity {
|
||||
const materialCompute = new Material(
|
||||
quadVert,
|
||||
sphereParticleComputeFrag,
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetTwoDrawBuffers } },
|
||||
);
|
||||
|
||||
materialCompute.addUniform( 'particlesSqrt', '1f', PARTICLES_SQRT );
|
||||
|
@@ -2,7 +2,7 @@ import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers, dummyRenderTargetTwoDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
@@ -23,7 +23,7 @@ export class Trails extends Entity {
|
||||
const materialCompute = new Material(
|
||||
quadVert,
|
||||
trailsComputeFrag,
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTargetTwoDrawBuffers } },
|
||||
);
|
||||
|
||||
materialCompute.addUniform( 'trails', '1f', TRAILS );
|
||||
|
@@ -6,6 +6,14 @@ export const dummyRenderTarget = new BufferRenderTarget( {
|
||||
name: process.env.DEV && 'dummyRenderTargetOneDrawBuffers',
|
||||
} );
|
||||
|
||||
export const dummyRenderTargetTwoDrawBuffers = new BufferRenderTarget( {
|
||||
width: 1,
|
||||
height: 1,
|
||||
numBuffers: 2,
|
||||
name: process.env.DEV && 'dummyRenderTargetFourDrawBuffers',
|
||||
} );
|
||||
|
||||
|
||||
export const dummyRenderTargetFourDrawBuffers = new BufferRenderTarget( {
|
||||
width: 1,
|
||||
height: 1,
|
||||
|
Reference in New Issue
Block a user