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

Re: [Public WebGL] Proposal for WEBGL_render_to_float




Regarding ClearColor, OpenGL specifications up to 4.2 specified clampf arguments to glClearColor. This spec. bug was fixed in an update to OpenGL 4.2. (The spec now has the opposite problem: it does not specify clamping for fixed-point buffers). I recommend leaving the *_color_buffer{_half,}_float specs as is. Implementations should clear via drawing a full screen quad when running on older versions of OpenGL that are clamping. The performance difference should be small, certainly nowhere near a MajorPerformanceCaveat. Implementations can still use glClear if the specified clear color is between 0 and 1. 

This clamping problem must have always existed for implementations exposing float rendering implicitly via OES_texture{_half,}_float.

Regarding blending, I  recommend changing WEBGL_color_buffer_float to make the blending behavior the same as EXT_color_buffer_float. This will allow implementations of WebGL 1 to expose it on OpenGL ES 3.x class hardware. We should create a new extension, WEBGL_blend_float say, to allow full blending to be exposed when running on desktop. There is no equivalent OpenGL ES extension, from which we can conclude that no mobile GPUs have yet added this feature. IIRC, it was omitted from OpenGL ES 3.x because of the number of gates it would require. Intermediate computations for both blending and filtering require more than 32-bits. It was felt that the cost outweighed the benefit.

This leaves a problem for implementations exposing floating-point rendering implicitly via OES_texture_float. They may today support blending when running on desktop-class hardware. Since OES_texture_float says to follow WEBGL_color_buffer_float, they would now be prohibited from allowing that blending. There are 2 choices I see

  1. Attempt to change a ratified extension to state that applications implicitly enabling float rendering act as if both WEBGL_color_buffer_float and WEBGL_blend_float are enabled. Drawback: they could not now expose float rendering on OpenGL ES-class hardware or D3D9.
  2. Live with the regression. blending couldn’t have worked on ES-class hardware anyway and likely hasn’t been working on D3D9, unless ANGLE is jumping through hoops. Therefore the number of affected applications is likely to be small.

I recommend #2.

Regards

    -Mark

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail