[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] The Newly Expanded Color Space Issue

On 08/09/2010 05:43, Kenneth Russell wrote:

I believe there is a fundamental reason why WebGL can not use an sRGB
color space by default, which is that OpenGL ES 2.0 does not have any
sRGB support, not even in the form of an extension. (EXT_texture_sRGB
exists on desktop hardware.) As I understand it, the way that most
WebGL implementations would support an sRGB color space for the back
buffer would be to use an sRGB texture as the color attachment for the
FBO they use behind the scenes. If this is correct, then it will be
impossible to make WebGL use an sRGB color space on mobile hardware.
Since a major motivating factor of the WebGL specification has been to
provide a uniform API and behavior between desktop and mobile
hardware, I do not think this is a viable option at the present time.
The purpose of SRGB8{,_ALPHA8} formats are to make it easier to use sRGB assets in a physically linear color space and to export sRGB from the linear color space. They have nothing do providing an sRGB space for processing. All processing is still done in a linear space.

[BTW these formats are no longer extensions on the desktop. They have been in core for some time now.]

An WebGL implementation using an SRGB8_ALPHA8 renderbuffer for the back buffer would actually be correctly providing a linear space for all the shader computations and therefore input textures should be provided in linear space.

In the case of OpenGL ES, since, I think it is safe to say all, displays on mobile devices with OpenGL ES have sRGB displays, and since no color space conversions are done, they are effectively providing an sRGB color space for the shader computations. This is the status quo noted by others.



fn:Mark Callow
org:HI Corporation;Graphics Lab, Research & Development
adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan
title:Chief Architect
tel;work:+81 3 3710 9367 x228
tel;fax:+81 3 5773 8660
url:http://www.hicorp.co.jp,  http://www.mascotcapsule.com