PBR materials support for WebGL 1


#1

Hello all.
First of all thanks for creating a new well-supported 3D engine for haxe.

I have a question why PBR materials are limited only for WebGL 2.0 or above for html5 output. Other popular 3D js engines such as three.js or babylon.js seem to support PBR for both WebGL 1 and 2.

I’m asking this because not all browsers are supporting WebGL 2.0 yet according to this site : https://www.caniuse.com/#search=webgl

Thanks


#2

i guess that because in Heaps they’re using multi render target feature which is available only in WebGL 2. So to make it work on WebGL 1 PBR material render should be modified


#3

I’m not sure what does multi render mean. But supporting PBR for both webgl 1 and 2 is vital for me. I can’t say to users that their browser is not supported. But on the other hand i see no alternatives to Heaps as 3d engine for haxe. There was a port of babylon.js to Babylon.hx but it seems abandoned right now.


#4

There are several reasons for WebGL2 restriction:

  • we are using multiple render targets, which are possible in WebGL 1 with extension, but not standard . Still this is not blocking as we have the MRT extension support in Heaps.
  • we are using float (hdr) textures, which are possible in WebGL 1 with extension, but not standard (this we do not support correctly yet)
  • in order to create the irradiance map from the cube env map we need to be able to render to a specific mipmap and I think this is not possible in WebGL1
  • at runtime we also need to get a specific lod (mipmap) from the irradiance map, which is also an unsupported extension

So I think that we some extra support we could indeed support WebGL 1 with PBR, I can help if someone wants to get it running.