[x3d-public] X3DOM Documentation: Gamma Correction

Michalis Kamburelis michalis.kambi at gmail.com
Tue Sep 1 02:55:35 PDT 2020


It's a great explanation of how and why gamma works in X3DOM :)

It was an inspiration for my own reading about gamma (results on
https://github.com/michaliskambi/x3d-tests/wiki/Gamma-correction-in-X3D-and-glTF
) and finally implementation of gamma correction in Castle Game Engine (
https://castle-engine.io/manual_gamma_correction.php ).

Note that in CGE I made a bit different decisions than X3DOM:

- In CGE, the default is different. We apply gamma by default only on
PhysicalMaterial, and we don't apply it on Material and UnlitMaterial. Of
course it can be changed (to apply gamma always -- compatible with X3DOM,
or never). The explanation how and why is on
https://castle-engine.io/manual_gamma_correction.php . I made such default
behaviour to keep backward compatibility, otherwise introducing gamma in
CGE would change the look of almost all existing models.

    So, long story short: if you set in CGE "GammaCorrection :=
gcPhysicalMaterial" (using code, or using view3dscene menu item) than CGE
and X3DOM make 100% compatible gamma handling.

- We don't yet support X3DOM "Environment" node (with
"gammaCorrectionDefault" field) because there wasn't much need for it. CGE
developers have a simple global variable to adjust it from Pascal. One day
I'll add "Environment.gammaCorrectionDefault" support, but it's lower
priority now.

Regards,
Michalis

pon., 31 sie 2020 o 22:22 Don Brutzman <brutzman at nps.edu> napisał(a):

> Michalis, wondering what you thought about this?
>
> https://doc.x3dom.org/tutorials/lighting/gamma
>
> "If you know what gamma correction is, you may just want to know that:
> Lighting in X3DOM can be gamma-correct or not, depending on the Environment
> node’s gammaCorrectionDefault field. RGB Colors and textures are assumed to
> be gamma coded. Intensities of all sorts are assumed to be linear. You can
> use gamma correction with the "gammaCorrectionDefault" attribute:" [...]
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics
> http://faculty.nps.edu/brutzman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200901/924744fa/attachment.html>


More information about the x3d-public mailing list