Login  Register

Re: Proper gamma-aware rendering

Posted by Sven Gothel on Dec 19, 2014; 4:01pm
URL: https://forum.jogamp.org/Proper-gamma-aware-rendering-tp4030515p4033790.html

On 12/19/2014 03:12 PM, elect [via jogamp] wrote:

>     Sven Gothel wrote
>     This is not a canonical reference,
>     hence your assumption would need some reason,
>     e.g. a EGL, GLX, WGL .. reference.
>
>     As I understand, you assume either:
>       [1] SRGB selection as a context property
>       This does not exist in the GL spec.
>
>       [2] SRGB selection as a pixelformat property
>       We have to look, but I doubt.
>
>     One may select SRGB texture formats, GL spec.
>
>     I am unaware of a generic overall SRGB mode,
>     but if you have information about it (GL, EGL, ..)
>     that would be great.
>
>     ~Sven
>
>     signature.asc (828 bytes)
>     <http://forum.jogamp.org/attachment/4033786/0/signature.asc>
>     <http://forum.jogamp.org/attachment/4033786/0/signature.asc%3E>
>
> Unfortunately documentation over internet regarding sRGB for the default
> framebuffer lacks. What I linked is the only source mentioning something about
> it and therefore this is the only thing my assumption is based on. I had the
> hint of the context reading this guy
>
> http://stackoverflow.com/questions/25842211/opengl-srgb-framebuffer-oddity
>
> In the GL pipeline one should work in linear RGB (lRGB). OpenGL offers all the
> tools to make it without any additional modification for the devs and, more
> important, free performance-wise. This means sRGB textures as input will be
> translated automatically to lRGB and output textures to sRGB, default
> framebuffer included, if properly configured.
So, we would need a GLCapabilities extension for colorspace selection.
Maybe this has to be defined in it's parent Capabilities, allowing to
select the default framebuffer / pixelformat (-> onscreen).

This 'Capabilities.colorspace' entry shall be utilized for
[1] onscreen drawables and [2] offscreen FBO drawables, if available.

<https://en.wikipedia.org/wiki/SRGB>

Capabilities.colorspace might be of an integer or enum type
w/ (currently known) values: lRGB (default, linear) and sRGB (standardized RGB).
We may refactor TextureData.Colorspace and extend it's type accordingly.

Onscreen drawables will require assistance of EGL, GLX, EGL ..,
where FBO offscreen can be supported merely by 'some' GL extension(s).

Implementation
==================
<https://en.wikipedia.org/wiki/SRGB#Usage> refers to EXT/framebuffer_sRGB
<https://www.opengl.org/registry/specs/EXT/framebuffer_sRGB.txt>
which will allow implementing [2]!

Note: While FBObject shall support sRGB naturally,
one can already use above extension in their own code using textures and FBOs.

It has to be seen, whether implementation of [1] is supported, i.e. possible.

+++

Please copy/paste this information and text to a new bug report (enhancement)
for our records.

Volunteers ?

Thank you!

~Sven

>
> Scanning Jogl, I found some interesting variables about the same thema
>
> EGL.java
>   public static final int EGL_VG_COLORSPACE_sRGB = 0x3089;
>   public static final int EGL_VG_COLORSPACE_LINEAR = 0x308A;
> WGLExt.java
>   public static final int WGL_ARB_framebuffer_sRGB = 1;
>   public static final int WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB = 0x20A9;
>   public static final int WGL_EXT_framebuffer_sRGB = 1;
>   public static final int WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20A9;
> GLX.java
>   public static final int GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB = 0x20B2;
>  public static final int GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20B2;
>
> I hope that helps
>
> ------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/Proper-gamma-aware-rendering-tp4030515p4033788.html
> To start a new topic under jogl, email [hidden email]
> To unsubscribe from jogl, click here
> <
> NAML
> <
http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; fax : +49 (471) 4707741
Timezone CET: PST+9, EST+6, UTC+1


signature.asc (828 bytes) Download Attachment