I want to be able to choose whether to use webgl 1.0 or webgl 2.0 by checking which device or browser my content is running on. Is this possible? if yes how do i do it?
To my knowledge, you cannot set the API manually.
Also, there is no point in forcing to use v1 when the browser supports v2 since the latter is (in my experience) always noticably faster anyway.
In older Unity versions (where WebGL 1.0 hasn’t been deprecated yet) you can set it up in player settings so that v2 and v1 are both in the list of display APIs with v2 on top. In that case, if you run the app in a browser that does not support WebGL v2 it will instead use v1.
However, the issue with that is that you are forced to use Gamma color space even in v2. And you forfeit many of the benefits of v2 because of that.
It is simply best these days to only support v2 and to use Linear color space.
What you can do is to disable AA or some other rendering features (shadows, full-screen fx, etc) that are costly in performance based on the device/browser or versions thereof in case you run into performance issues on older devices.
thank you