godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91k stars 21.17k forks source link

WebGL 2 depth/hdr does not work on HTML5 export #16021

Closed gerardabello closed 4 years ago

gerardabello commented 6 years ago

I thought this was related to issue #13985, but this shows in firefox 58+.

Godot version: Godot 3.0 rc2

OS/device including version: Ubuntu 17.10 Nvidia GTX660

Issue description: I have a small project and this is how it looks on the editor/linux export: image

But it looks like this on chromium 63: image and like this in firefox 58/59: image

It looks like the sky texture has the problem, so I tweak some settings in the import. Setting Srgb to Enable, makes it better on firefox, but not perfect: image You can see there are some weird colors at the dark part of the asteroid that I don't know how to get rid of. It also happens on the sky texture but it is not as visible.

In chrome there is no change.

Steps to reproduce: Open the project and export to HTML. Open in browser. Lightning is too bright in firefox and too dark in chrome. Change 'textures/skymap_8k.jpg' import setting Srgb to Enable. Export again to html. Now the lightning is ok in firefox but dark parts of the image have some weird colors.

Minimal reproduction project: game.zip

gerardabello commented 6 years ago

Just discovered that disabling depth/hdr in the project settings, makes the editor/linux export have the same look as the html5 export, so I guess that the problem is that this setting does not work on html5.

lastrodamo commented 6 years ago

@gerardabello i disabled depth/hdr in the project setting and export for Firefox 59.0.2. But i have the same result of your firefox 58/59 image.

With the latest godot version in my godot projects, if i use jpg format image for hdr WorldEnvironnement map.

And to have a good result on html i check on my materials :

I don't have brightness effect (wrong color aspect) html export on Firefox 56

akien-mga commented 5 years ago

Is this still reproducible with the GLES2 / WebGL 1 renderer in the current master branch?

gerardabello commented 5 years ago

Is this still reproducible with the GLES2 / WebGL 1 renderer in the current master branch?

I cannot use the master branch directly, but with 3.1 stable and GLES2 there seems to be no issue: image This is without changing any import setting. It does not looks the same as the GLES3 renderer, although I imagine this is expected.

With GLES3 the issue persists.

Calinou commented 5 years ago

HDR isn't supported in GLES2, whereas HDR is supported (and enabled by default on desktop platforms) in GLES3.

akien-mga commented 4 years ago

I can confirm that it works OK in Firefox and Chromium on Linux with GLES2, but still exhibits the same issue as in the OP with GLES3 (current master branch).

This is unlikely to be fixed as WebGL 2.0 support in browsers proved to be quite poor, so the focus for the web platform is on WebGL 1.0 (and the GLES3/WebGL 2.0 renderer will be removed in Godot 4.0, thus obsoleting this issue). Still, we can keep this open for now in case someone really wants this to work on WebGL 2.0 and wants to investigate. A fix could be backported to the 3.2.x branch.

clayjohn commented 4 years ago

Closing as the issue likely lies with WebGL 2.0 and not our code. WebGL 2.0 is still poorly supported and it looks like WebGPU will be supported before WebGL 2.0 is.