#WebGPU, URP and GL class
1 messages · Page 1 of 1 (latest)
Hey @mighty wing , in the GL documentation (https://docs.unity3d.com/ScriptReference/GL.html) it recomends not using Immediate Mode drawing:
Note that in almost all cases using Graphics.RenderMesh or CommandBuffer is more efficient than using immediate mode drawing
Is there a reason you can't use Graphics.RenderMesh or CommandBuffer instead of GL?
I checked in with our devs who had this advice for 2d shapes:
I can see why it would be convenient to use in this 2d case. But they do not actually need to create a mesh in order to use the C# drawing commands. It's a bit more involved, but they can manually set the vertex data in a graphics buffer, and draw using one of the available commands (e.g. Graphics.RenderPrimitivesIndexed, Graphics.RenderPrimitives)
They would need to test and compare, but I don't think the GL API should perform better than a command like Graphics.RenderPrimitives, even when setting vertex data every frame. It may even have a small overhead of C# side, but for some small amount of geometry it may not matter.
Okay, but otherwise, is GL API available with URP or it’s dependent on built in pipeline?
Just for me to know if the URP migration means also a mandatory GL->Graphics migration.
Yeah GL API should work with URP.
You can also sign up for early access to WebGPU here for any initial testing:
https://forum.unity.com/threads/early-access-to-the-new-webgpu-backend-in-unity-2023-3.1516621/
Much appreciated for the answers.