Search Unity

DOTS Physics is not good enough for webgl?

Discussion in 'Physics for ECS' started by wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI, Jan 28, 2021.

  1. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    i used Unity Physics 0.5 for webgl to test,the fps is so low , Dose the unity team will consider to Optimize it in webgl???
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,201
    One of the major advantages to DOTS is multithreading your code and a physics engine would be a good example of code that benefits heavily from threading, but last I checked Unity's WebGL implementation completely lacked multithreading which largely eliminates this benefit.

    If this is still accurate then I wouldn't expect any improvements until they've added support for threading to WebGL.
     
  3. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    669
    I think the current expectation is if you want to use DOTS + WebGL, you'd use the tiny runtime, but I don't know if that supports the Unity.Physics package yet.
     
  4. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    I have tested, the unity physics in webgl can run, but the existence of bugs and run the effect is not ideal
     
  5. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    thanks,maybe i shouldnt use it for webgl
     
  6. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Unity.Physics should work in Tiny, we've been testing it and fixing issues when they arise. Please let us know if it worked for you.
     
    steveeHavok likes this.
  7. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    Yeah, many of the Tiny Samples use DOTS Physics. What are you trying to simulate?
     
  8. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    i want it can work in webgl very smooth,i want it can work in webgl very smooth,but now the fps in webgl of Dots physics is very low.u guys can test it with https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/UnityPhysicsSamples (the same demo in web or in pc,the fps is so different,If it is phyx's built-in physical engine, the FPS on the web page is much higher than the dots version)
     
  9. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    i want it can work in webgl very smooth,i want it can work in webgl very smooth,but now the fps in webgl of Dots physics is very low.u guys can test it with https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/UnityPhysicsSamples (the same demo in web or in pc,the fps is so different,If it is phyx's built-in physical engine, the FPS on the web page is much higher than the dots version)
     
  10. wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    wechat_os_Qy07am7Wy1_qI2hEgygU9lgVI

    Joined:
    Aug 10, 2019
    Posts:
    48
    However, there seems to be a problem with unity Phyiscs in webgl. If I package it as webgl, I will be prompted to report an error. The error information is as follows:at http://localhost:52034/Build/www.wasm.gz:wasm-function[28716]:0xbb2cf3....

    is there any solution,thanks for advance!