Is it possible to measure rendering time in webgl using gl.finish()?

前端 未结 3 1976
暖寄归人
暖寄归人 2021-01-12 13:09

I am trying to measure the time it takes for an image in webgl to load.

I was thinking about using gl.finish() to get a timestamp before and after the image has load

3条回答
  •  醉梦人生
    2021-01-12 13:39

    Being client based, WebGL event timings depend on the current loading of the client machine (CPU loading), GPU loading, and the implementation of the client itself. One way to get a very rough estimate, is to measure the round-trip latency from server to client using a XmlHttpRequest (http://en.wikipedia.org/wiki/XMLHttpRequest). By finding the delay from server measured time to local time, a possible measure of loading can be obtained.

提交回复
热议问题