Skip to content

Commit

Permalink
More descriptive shader names for Particle Emitter simulation shaders (
Browse files Browse the repository at this point in the history
…#6701)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky committed Jun 14, 2024
1 parent d10dece commit e059f55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scene/particle-system/particle-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,10 @@ class ParticleEmitter {

// Note: createShaderFromCode can return a shader from the cache (not a new shader) so we *should not* delete these shaders
// when the particle emitter is destroyed
const params = this.emitterShape + '' + this.pack8 + '' + this.localSpace;
this.shaderParticleUpdateRespawn = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeRespawn, 'fsQuad0' + params);
this.shaderParticleUpdateNoRespawn = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeNoRespawn, 'fsQuad1' + params);
this.shaderParticleUpdateOnStop = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeOnStop, 'fsQuad2' + params);
const params = `Shape:${this.emitterShape}-Pack:${this.pack8}-Local:${this.localSpace}`;
this.shaderParticleUpdateRespawn = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeRespawn, `ParticleUpdateRespawn-${params}`);
this.shaderParticleUpdateNoRespawn = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeNoRespawn, `ParticleUpdateNoRespawn-${params}`);
this.shaderParticleUpdateOnStop = createShaderFromCode(gd, shaderChunks.fullscreenQuadVS, shaderCodeOnStop, `ParticleUpdateStop-${params}`);

this.numParticleVerts = this.useMesh ? this.mesh.vertexBuffer.numVertices : 4;
this.numParticleIndices = this.useMesh ? this.mesh.indexBuffer[0].numIndices : 6;
Expand Down

0 comments on commit e059f55

Please sign in to comment.