# Babylon React Native Compute Shaders

**URL:** <https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568>\
**Category:** Questions\
**Created:** [January 22, 2023, 1:41pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568 "2023-01-22T13:41:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![screensailor](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/screensailor/32/29450_2.png) [@screensailor](https://forum.babylonjs.com/u/screensailor)\
**Post date:** [January 22, 2023, 1:41pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/1 "2023-01-22T13:41:40Z")

</div>

I am very much looking forward to [compute shaders](https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/computeShader) in React Native apps. The current version of Babylon React Native is still using WebGL, which means that it is not yet possible to use this package to run compute shaders. I was wondering if anyone knows if this is on the roadmap?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 23, 2023, 11:30am UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/2 "2023-01-23T11:30:43Z")

</div>

cc @bghgary

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 23, 2023, 4:21pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/3 "2023-01-23T16:21:24Z")

</div>

> [@screensailor](#):
>
> Babylon React Native is still using WebGL

Babylon React Native does not use WebGL underneath. It is however using GLSL. The [compute extension for WebGL2](https://registry.khronos.org/webgl/specs/latest/2.0-compute/) has been halted in favor of WebGPU. Given that, the best way to get compute shader support in Babylon (React) Native would be to support WebGPU way of doing compute shaders. I unfortunately don’t know how that works. @Evgeni_Popov Any thoughts?

---

<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:** [January 23, 2023, 5:02pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/4 "2023-01-23T17:02:41Z")

</div>

Support for compute shaders in WebGPU is done using WGSL:

> **[Compute Shaders | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/materials/shaders/computeShader)**
>
> Learn about the compute shaders in Babylon.js.

I’m not sure WGSL could be translated to some other languages on native side(?)

We could use some other languages than WGSL, though, with minor changes to `Compute/computeShader` and `Compute/computeEffect` (`ComputeEffect` assumes the language is WGSL).

Then, a number of methods have to be implemented by the engine:

> <https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Engines/Extensions/engine.computeShader.ts>

The modeling was done on the basis of WebGPU, maybe it will need some adjustments if compute shaders work differently in other environments.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 23, 2023, 5:31pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/5 "2023-01-23T17:31:17Z")

</div>

> [@Evgeni\_Popov](#):
>
> I’m not sure WGSL could be translated to some other languages on native side(?)

I guess you would need tint to convert to your native platform of choice.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [January 23, 2023, 9:02pm UTC](https://forum.babylonjs.com/t/babylon-react-native-compute-shaders/37568/6 "2023-01-23T21:02:57Z")

</div>

> [@screensailor](#):
>
> I was wondering if anyone knows if this is on the roadmap?

To answer this question explicitly, no, this is not on the roadmap at the moment. WebGPU is still relatively new and getting compute shaders working in native will take some work. Feel free to file a feature request in the BabylonNative repo in case others are interested.
