WebGL Pen Pressure Support

I’m making a 3D painting app in Unity, where users can paint a model and share with their friends
Since the social aspect is important I’m doing a WebGL build for easy sharing online
But I noticed the Pen input is not fully supported in Unity WebGL builds, especially pen pressure

https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/manual/SupportedDevices.html

It seems now browsers can track pen pressure with no problem, when testing with my Wacom tablet

https://patrickhlauke.github.io/touch/pen-tracker/

So it would be great to have pen pressure support in Unity for WebGL builds too
It could help people to create more creative apps and games with Unity
And plenty of painting tools could make good use of it

1 Like

It would also be helpful for me, @Rene-Damm can you help with it?

1 Like

Hi,

Unfortunately I don’t think it’s currently supported by emscripten html5.h — Emscripten 3.1.65-git (dev) documentation on which we rely for majority of webgl input.

I would recommend creating a feature request in emscripten repo Issues · emscripten-core/emscripten · GitHub and then a bug report in unity (help->report a bug) as well for tracking purposes.

In meanwhile, I believe the easiest way to unblock you is to write a custom javascript code to use dom pointer events directly, pass data into C++ as usual and write a custom input device that implements pen state.

@dmytro_at_unity Thanks for the pointer
I found this thread where someone already suggested this a long time ago
For some reason it keeps being closed and reopened

@Lemovision I’ve talked to webgl devs, they suggest it’s should be faster to implement it in Unity rather than in emscripten. Would you mind to create a bug report then so we can track it as external request? Thanks!

1 Like

@dmytro_at_unity Okay thanks for that!
Alright sure, I just sent a bug report now

1 Like

This is the bug page if you guys interested

1 Like