Menu

#2 Spherical environment map not working on WebGL

v1.0 (example)
open
nobody
None
5
2020-02-19
2020-02-02
RonTek
No

Applying a texture with spherical environment mapping flag set (64) does not work on WebGL, only on OpenGL/desktop.

Discussion

  • UltraBas

    UltraBas - 2020-02-17

    Currently, spherical environment mapping is not implemented on WebGL. The reason is that spherical mapping was provided mostly for historical retrocompatibility, since even in the latest versions of Blitz3D it was usually replaced by cubemapping, that was more efficent and more effective in most cases. Still, OpenB3D kept supporting spherical mapping since fixed function pipeline provided it (and, in theory, OpenB3D could be used on older graphic card that don't support cube mapping).
    The WebGL version requires a graphic card supporting programmable pipeline, and all of them support cubemapping, so having sphere mapping as a fallback is not necessary. And adding support for it, unfortunately, would double the complexity of the shaders generated by the library, since all possible combinations of lights and textures would have to be updated to include one more case.

     
    • RonTek

      RonTek - 2020-02-19

      Thanks and got it now. Would it be possible or just ideal to fallback to shaders on gles/webgl build and perhaps add it to openb3dplus and replicate the same effect (1 light and 1 texture?) on GL? cheers.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.