New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 630498 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue angleproject:1553

Blocking:
issue 728465
issue 728466



Sign in to add a comment

Implement WEBGL_compressed_texture_s3tc_srgb draft extension

Project Member Reported by kbr@chromium.org, Jul 22 2016

Issue description

https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/ has been moved to draft status after discussion in the WebGL working group and should be implemented behind the --enable-webgl-draft-extensions command line flag.

This is a request from Unity and should be prioritized.

 

Comment 1 by kbr@chromium.org, Aug 16 2016

Status: Available (was: Untriaged)

Comment 2 by kbr@chromium.org, Aug 16 2016

Cc: kainino@chromium.org
This would be a good starter bug -- pretty easy.

Any progress on this extension?

Now that we shipped WebGL 2.0 https://blogs.unity3d.com/2016/08/30/get-the-unity-5-5-beta-now/ this is all we need to expose linear rendering https://docs.unity3d.com/Manual/LinearLighting.html in WebGL.

Thanks!
Christophe

Comment 4 by kbr@chromium.org, Aug 31 2016

Owner: kainino@chromium.org
Status: Assigned (was: Available)
Let's ask our new team member Kai to pick this up. It should be simple and a good introduction to how to wire up these extensions.

Thanks!
Christophe,

I started work on this and we quickly ran into a complication. Unity's solution to this issue may provide some insight into how we want to implement this.

As far as I understand, OpenGL ES does not expose a direct equivalent of Desktop GL's EXT_texture_sRGB. There are only: EXT_sRGB (which does not define anything about S3TC), and NV_sRGB_formats (which seems to be NVIDIA-specific).

My question is this: What extension(s) does Unity use on GL ES (on mobile) to implement linear rendering?
Hi Kai,

We don't really support WebGL on mobile right now. Also it's something we are interested, it doesn't seem we are just ready yet for this. It's already hard on desktop! :)

WEBGL_compressed_texture_s3tc_srgb is for running WebGL on desktop where we rely on DXT. On desktop ~100% of the devices support sRGB textures and framebuffers. On mobile pure C++ OpenGL ES, we rely on ETC2 (that have sRGB formats) for Android and sRGB PVRTC (GL_EXT_pvrtc_sRGB). This actually imply that down the line when we will have something practical for mobile... we will need a WEBGL_compressed_texture_pvrtc_srgb extension too. On mobile, essentially only Android ES3 and ~98% iOS devices have sRGB texture and framebuffers (requires iOS 7 and a GPU that is not a PowerVR SGX 535). We don't think it's possible / reasonable to support linear rendering on Android ES2 and iOS PowerVR SGX 535 devices.

On desktop, we are also interested in OpenGL ES support on Windows where both NVIDIA and Intel has OpenGL ES support with WGL. We checked NV_sRGB_formats for NVIDIA and it turns out Intel drivers just work with the sRGB DXT enum... not a great solution indeed.

I actually reported the lack of extension sRGB DXT extension to Intel at the same time as I submitted this extension to Ken (Feel free to complain to Intel too! :)). I might draft one for ES too actually especially if that's useful for you.

Thanks,
Christophe
Cc: christop...@unity3d.com
Christophe,

Thanks for your helpful reply. In Chrome, when we run a WebGL2 context, it (usually) runs atop a GLES3 context (whether this is real or virtualized by ANGLE). While GLES3 (and WebGL2) have native sRGB support, and S3TC support via extensions, there is no support available for sRGB S3TC textures except via NV_sRGB_formats.

For Chrome, I think ANGLE might have to implement a special ANGLE_ extension to the ES context to expose sRGB S3TC support.

I wonder if it might make more sense for Unity to use sRGB ETC2 textures on WebGL2, although I don't know if that's practical.

-Kai
sRGB ETC2 doesn't really make sense for us because the hardware on desktop doesn't support the format (except Intel Skylake...) so somewhere it's going to be compressed and cost a lot of performance due to higher bandwidth. 

WebGL is already a big step backward in term of performance compared to our WebPlayer plug-in so a lot of our effort goes into catching up.

Thanks,
Christophe

Comment 10 by kbr@chromium.org, Sep 7 2016

In Chromium's internals, which are all based on OpenGL ES, I think we can claim that we support the NV_sRGB_formats extension on desktop platforms, and use that as the signal that WEBGL_compressed_texture_s3tc_srgb should be enabled.

It could be helpful to have an OpenGL ES EXT_ extension for this, so Christophe, if you'd be willing to write one up, we'd expose it in ANGLE.

Thanks.

Project Member

Comment 11 by bugdroid1@chromium.org, Sep 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/692194d1c8295d88a60230f24fee887026dae424

commit 692194d1c8295d88a60230f24fee887026dae424
Author: kainino <kainino@chromium.org>
Date: Sat Sep 17 00:03:16 2016

Implement WEBGL_compressed_texture_s3tc_srgb

Enables support on non-ANGLE desktop platforms (Mac/Linux) and GLES platforms supporting NV_sRGB_formats (Tegra).

This is tested by WebGL conformance test
conformance/extensions/webgl-compressed-texture-s3tc-srgb.html

BUG= 630498 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
TBR=haraken@chromium.org

Review-Url: https://codereview.chromium.org/2337833002
Cr-Commit-Position: refs/heads/master@{#419333}

[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/gpu/command_buffer/service/feature_info.cc
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/gpu/command_buffer/service/feature_info_unittest.cc
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/gpu/command_buffer/service/texture_manager.cc
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/BUILD.gn
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h
[add] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp
[add] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.h
[add] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.idl
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLExtensionName.h
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/692194d1c8295d88a60230f24fee887026dae424/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Project Member

Comment 12 by bugdroid1@chromium.org, Sep 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f960e8b709a40c733e6b203b9bac5d58a093b2d1

commit f960e8b709a40c733e6b203b9bac5d58a093b2d1
Author: kainino <kainino@chromium.org>
Date: Mon Sep 19 21:56:07 2016

Mark WEBGL_compressed_texture_s3tc_srgb as draft

Plus add TODO for https://bugs.chromium.org/p/chromium/issues/detail?id=647892

BUG= 630498 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2346973004
Cr-Commit-Position: refs/heads/master@{#419583}

[modify] https://crrev.com/f960e8b709a40c733e6b203b9bac5d58a093b2d1/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
[modify] https://crrev.com/f960e8b709a40c733e6b203b9bac5d58a093b2d1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp

Blockedon: angleproject:1553

Comment 15 by kainino@google.com, Dec 13 2016

Status: Started (was: Assigned)
Project Member

Comment 16 by bugdroid1@chromium.org, Dec 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/21f75e536140c26df267a20dfd6475a7e87c6072

commit 21f75e536140c26df267a20dfd6475a7e87c6072
Author: kainino <kainino@chromium.org>
Date: Tue Dec 13 23:35:56 2016

improve feature detection for S3TC+sRGB textures

This should _actually_ enable WEBGL_compressed_texture_s3tc_srgb on Mac
(and potentially some other platforms that support but do not advertise
EXT_texture_sRGB). It will also enable it on ANGLE, once ANGLE
implements the currently-draft OpenGL ES extension
EXT_compressed_texture_s3tc_srgb.

BUG= 630498 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2569763003
Cr-Commit-Position: refs/heads/master@{#438337}

[modify] https://crrev.com/21f75e536140c26df267a20dfd6475a7e87c6072/gpu/command_buffer/service/feature_info.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Dec 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/d5fe352a9139de225a4473390dd6b266ca841d57

commit d5fe352a9139de225a4473390dd6b266ca841d57
Author: Kai Ninomiya <kainino@chromium.org>
Date: Thu Dec 22 22:55:46 2016

Add GL_EXT_texture_compression_s3tc_srgb to GLES2/gl2ext.h

This extension is currently in draft; ANGLE will be the first implementation.

BUG= angleproject:1553 
BUG= chromium:630498 

Change-Id: I795caa36f722a347cb7924990b60452d51b1e177
Reviewed-on: https://chromium-review.googlesource.com/423435
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>

[modify] https://crrev.com/d5fe352a9139de225a4473390dd6b266ca841d57/include/GLES2/gl2ext.h

Project Member

Comment 18 by bugdroid1@chromium.org, Dec 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8438beb74dd3443e928c2e53082dbde81ca1900

commit f8438beb74dd3443e928c2e53082dbde81ca1900
Author: jmadill <jmadill@chromium.org>
Date: Fri Dec 23 16:29:06 2016

Roll ANGLE b8a580a..d5fe352

https://chromium.googlesource.com/angle/angle.git/+log/b8a580a..d5fe352

BUG= 676333 , 676689 , 672719 , 668223 , 630498 

TBR=geofflang@chromium.org

TEST=bots

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2606473002
Cr-Commit-Position: refs/heads/master@{#440636}

[modify] https://crrev.com/f8438beb74dd3443e928c2e53082dbde81ca1900/DEPS

This should be fixed in the next ANGLE roll.
Project Member

Comment 20 by bugdroid1@chromium.org, Jan 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35b4553e325411865edb3873181869ea330a91d2

commit 35b4553e325411865edb3873181869ea330a91d2
Author: jmadill <jmadill@chromium.org>
Date: Mon Jan 09 21:43:16 2017

Roll ANGLE a66779f..037340d

https://chromium.googlesource.com/angle/angle.git/+log/a66779f..037340d

BUG=chromium:675997, chromium:630498 

TBR=geofflang@chromium.org

TEST=bots

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2621683003
Cr-Commit-Position: refs/heads/master@{#442361}

[modify] https://crrev.com/35b4553e325411865edb3873181869ea330a91d2/DEPS

Status: Fixed (was: Started)
Project Member

Comment 22 by bugdroid1@chromium.org, Jan 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/5c32a6ef82e68455e8e9716b2c61cf26f96c95b8

commit 5c32a6ef82e68455e8e9716b2c61cf26f96c95b8
Author: Kai Ninomiya <kainino@chromium.org>
Date: Tue Jan 31 02:22:38 2017

Fix comment introduced in 02f075c85b5e16b6ca1bfc157f1d619ed255f75a

BUG= angleproject:1553 
BUG= chromium:630498 

Change-Id: I4c341e57f2e0439ffd7bdcf74e15ca0de4152c5d
Reviewed-on: https://chromium-review.googlesource.com/435106
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>

[modify] https://crrev.com/5c32a6ef82e68455e8e9716b2c61cf26f96c95b8/src/libANGLE/Caps.h

Comment 23 by kbr@chromium.org, Jun 1 2017

Blocking: 728465
Blocking: 728466

Sign in to add a comment