[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Public WebGL] Gamma correction and texImage2D/texSubImage2D
- To: firstname.lastname@example.org
- Subject: [Public WebGL] Gamma correction and texImage2D/texSubImage2D
- From: Kenneth Russell <email@example.com>
- Date: Thu, 2 Sep 2010 19:01:36 -0700
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1283479298; bh=VXtbc0m8ajTkUtFQBAZ0qbUtIdk=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=JnLSxZli+NOdvzUQek2LjG2BVxrlB664Wph3zrGHopLfN3aSgkNJYj+kCDR/YFlYB v62vmsL7nCvvh8M/J2dPA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=m9E08WSrPMUGmElYEjSlqtWLKzKCSxSiW5rlHqdjKo0=; b=rfE3JoXcFLvCTXilnLwWMOTaAmGjzSHB/ZpUs4MPQLg2vX35UGZFalweK+RMdR5yzb UvVeUBACwGO8hsbV0XFA==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:date:message-id:subject:from:to:content-type; b=kKLpdFy4nnXQMX6LGrO46k5YiLbuFRCDoJsx7T+lRDbZAeADHDF590BwZC0nMvh6fb g6NtIQ93P5pqZsZocFWA==
- Sender: firstname.lastname@example.org
In the WebGL specification we've added pixelStorei parameters
UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL to handle
common use cases when uploading images from the browser via texImage2D
and texSubImage2D. It appears that we are going to need another one to
determine whether or not gamma correction needs to be applied during
the image upload. When displaying ordinary images on a web page, the
browser always performs gamma correction on the image data.
WebGL applications that want to encode non-image data in images
definitely do not want gamma correction to be applied; they want the
verbatim pixel data uploaded. For the display of random web images in
WebGL applications it is less clear. I don't know whether most 3D
applications would want to have the gamma-corrected or
non-gamma-corrected pixels uploaded, and in particular any
interactions with shading.
1. What should the name of the new (boolean) pixelStorei parameter be?
The name which would most closely match the other parameters would
probably be UNPACK_CORRECT_GAMMA_WEBGL, where "correct" is a verb.
However, this name is probably confusing (why would you ever want
"incorrect" gamma?). UNPACK_PERFORM_GAMMA_CORRECTION_WEBGL?
2. What should the default value of this flag be? If it were false,
then for images uploaded from the browser to WebGL, the default
behavior would be for the pixels to be completely untouched. However,
this might be surprising behavior to applications displaying images on
screen with very simple shader code (no lighting) and expecting them
to look the same as surrounding browser content. Still, I am inclined
to suggest that the default for the new flag be false to match most
other OpenGL behavior, where anything other than a pass-through of
data is optional and disabled by default.
You are currently subscribed to email@example.com.
To unsubscribe, send an email to firstname.lastname@example.org with
the following command in the body of your email: