# WebGPU gpu particle error

**URL:** <https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753>\
**Category:** Bugs\
**Tags:** particles, webgpu\
**Created:** [July 2, 2024, 11:17pm UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753 "2024-07-02T23:17:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpaleo.meetkai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpaleo.meetkai/32/38624_2.png) [@mpaleo.meetkai](https://forum.babylonjs.com/u/mpaleo.meetkai)\
**Post date:** [July 2, 2024, 11:17pm UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/1 "2024-07-02T23:17:05Z")

</div>

I’m using webgpu engine  
Here is how my particle looks like  
Texture is 512x512

When I add the size gradient it throws a lot of webgpu errors in the console + white screen crash (it works fine if I switch back to WebGL2 engine)

```auto
particleSystem.addSizeGradient(0, 0)
particleSystem.addSizeGradient(1, 1)

```

```auto
const particleSystem = new GPUParticleSystem('Smoke particles', { capacity: 50 }, scene)

particleSystem.particleTexture = texture
particleSystem.emitter = emitter
particleSystem.minEmitBox = new Vector3(-1, -0.1, -3)
particleSystem.maxEmitBox = new Vector3(1, 0.1, -3.2)

particleSystem.color1 = Color4.FromHexString('#7B7B7BFF')
particleSystem.color2 = Color4.FromHexString('#7B7B7BFF')
particleSystem.colorDead = new Color4(0, 0, 0, 0)

particleSystem.minSize = 0.1
particleSystem.maxSize = 2

particleSystem.addSizeGradient(0, 0)
particleSystem.addSizeGradient(1, 1)

particleSystem.minLifeTime = 0.3
particleSystem.maxLifeTime = 0.8

particleSystem.emitRate = 0

particleSystem.blendMode = ParticleSystem.BLENDMODE_ADD

particleSystem.gravity = new Vector3(0, 4, 0)

particleSystem.direction1 = new Vector3(0, 0, -5)

particleSystem.minAngularSpeed = 0
particleSystem.maxAngularSpeed = Math.PI

particleSystem.minEmitPower = 0.1
particleSystem.maxEmitPower = 1
particleSystem.updateSpeed = 0.008

particleSystem.forceDepthWrite = true

return particleSystem

```

Any ideas

 ![particle-error](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/e/4e40845832818c36597d76c26788680e138349e0.png)

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [July 3, 2024, 7:40am UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/2 "2024-07-03T07:40:34Z")

</div>

cc @sebavan

---

<div class="post-metadata">

**Author:** ![roland](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/roland/32/38940_2.png) [@roland](https://forum.babylonjs.com/u/roland)\
**Post date:** [July 3, 2024, 11:08am UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/3 "2024-07-03T11:08:11Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#0GZLMI%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Works for me.

Create a PG with your PS.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 3, 2024, 11:34am UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/4 "2024-07-03T11:34:33Z")

</div>

You probably need to enable the “float32-filterable” extension. The easiest way is to set `enableAllFeatures: true` in the option object passed to the WebGPU constructor.

---

<div class="post-metadata">

**Author:** ![mpaleo.meetkai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpaleo.meetkai/32/38624_2.png) [@mpaleo.meetkai](https://forum.babylonjs.com/u/mpaleo.meetkai)\
**Post date:** [July 3, 2024, 11:06pm UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/5 "2024-07-03T23:06:34Z")

</div>

Is there any negative impact on having enableAllFeatures to true ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 3, 2024, 11:37pm UTC](https://forum.babylonjs.com/t/webgpu-gpu-particle-error/51753/6 "2024-07-03T23:37:29Z")

</div>

Not that I know of.
