Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.25 KB

File metadata and controls

29 lines (20 loc) · 1.25 KB

Tone mapping for WebGL

Introduction

This proposal suggests a mechanism to indicate that the bitmap of a WebGLRenderingContextBase is HDR, and that it is to be rendered as HDR.

This fits into the HDR on the web, the big picture proposal. It is the "magenta sun number 5" and "magenta sun number 6" problem in the proposal diagram.

This builds on the common framework proposed in 2D canvas.

Proposal

To the WebGLRenderingContextBase interface, add the following function:

  partial interface WebGLRenderingContextBase {
    // If `toneMapping` is specified, then set the tone mapping of the
    // canvas' output bitmap to `toneMapping`. Return the tone mapping
    // of the canvas' output bitmap.
    attribute CanvasToneMapping drawingBufferToneMapping(optional CanvasToneMapping toneMapping)
  }

Note that this function provides setter and getter functionality. If specified with a toneMapping parameter, then it will operate as a setter. If specified with no parameter, then it will operate as a getter. This is because, unlike drawingBufferColorSpace, the value is a dictionary, This is similar to the drawingBufferStorage function.