Prechádzať zdrojové kódy

Merge pull request #8958 from sebavan/master

Fix Particles anim on some Intel GPUs...
David Catuhe 5 rokov pred
rodič
commit
5764d10b0f

+ 1 - 1
src/Particles/particleSystem.ts

@@ -1899,7 +1899,7 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
 
         if (this._isAnimationSheetEnabled && this.particleTexture) {
             var baseSize = this.particleTexture.getBaseSize();
-            effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, baseSize.width / this.spriteCellWidth);
+            effect.setFloat3("particlesInfos", this.spriteCellWidth / baseSize.width, this.spriteCellHeight / baseSize.height, this.spriteCellWidth / baseSize.width);
         }
 
         effect.setVector2("translationPivot", this.translationPivot);

+ 2 - 2
src/Shaders/particles.vertex.fx

@@ -135,8 +135,8 @@ void main(void) {
 	vColor = color;
 
 	#ifdef ANIMATESHEET
-		float rowOffset = floor(cellIndex / particlesInfos.z);
-		float columnOffset = cellIndex - rowOffset * particlesInfos.z;
+		float rowOffset = floor(cellIndex * particlesInfos.z);
+		float columnOffset = cellIndex - rowOffset / particlesInfos.z;
 
 		vec2 uvScale = particlesInfos.xy;
 		vec2 uvOffset = vec2(offset.x , 1.0 - offset.y);