<div><div dir="auto">I was very upset when X3DOM apparently diverged (or did X_ITE diverge), and despite applying recommended (?) fixes, the visual appearances were strikingly different between X3DOM and X_ITE.   I think I had learned helplessness or something, and I dropped the issue.   It’s great that another champion has taken up the challenge.</div><div dir="auto"><br></div><div dir="auto">Adding Holger so he is aware.</div><div dir="auto"><br></div><div dir="auto">John</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 1, 2020 at 11:44 AM Don Brutzman <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">We discussed further on today's teleconference.<br><br><br><br>The limited approach below attempts to say that gamma correction is important and should be applied if possible.<br><br><br><br>The various approaches we've looked at in glTF and the following references all take extremely similar approaches, with the only difference being default values chosen (for example 2.2 versus 2.0).<br><br><br><br>The following statements were not accepted (correct, incorrect or even ill-defined):<br><br><br><br>- The application of gamma correction may be affected by the display hardware being utilized.  This is why an X3D scene author cannot uniquely define whether gamma is part of a given X3D model, it is (at least partially or sometimes) dependent on the external display hardware.<br><br><br><br>- Another example was a camera might (or might not) apply gamma correction.<br><br><br><br>- Can we define if gamma correction is preferred?  Or applied?  Or a giant mystery?<br><br><br><br>I am unsatisfied that something so fundamental to presentation is also something that X3D has no opinion about, because it is too complicated.  We are better than that.  Silent acceptance of mysterious results seems insufficient.<br><br><br><br>I suspect that path to some form of improvement lies through simplicity, not complexity.<br><br><br><br>Recommendation:<br><br>- define what we do know,<br><br>- note that some things are difficult and the province of hardware and operating systems,<br><br>- suggest that browsers consider gamma correction whenever appropriate.<br><br><br><br>Thank you for discussing a difficult topic.  Hopefully we can add just a little value to X3D Architecture prose without making things worse.<br><br><br><br>On 9/1/2020 9:18 AM, Don Brutzman wrote:<br><br>> OK thanks.  If I follow your thinking completely, it sounds like we do not want to add to spec yet, rather keep it as a potential system feature.<br><br>> <br><br>> However, am not understanding rationale.  If gamma correction benefits and context and requirements and solution approaches are all well understood, why aren't we saying anything now in the X3D specification?<br><br>> <br><br>> In other words, what else would it take to add gamma considerations to X3D?  If X3D rendering is expected to be archival in nature, then it seems essential.  For starters, perhaps something as simple as<br><br>> <br><br>> ==================================================<br><br>> * X3D Architecture, clause 11 Rendering component<br><br>>    11.2.5 Gamma Correction<br><br>> <br><br>> Gamma correction is a nonlinear operation used to encode and decode luminance.<br><br>> <br><br>> Gamma encoding of images is used to optimize the usage of bits when encoding an image by taking advantage of the non-linear manner in which humans perceive light and color.<br><br>> <br><br>> It is recommended that X3D browsers support gamma correction for scene rendering whenever appropriate for the display device being used.<br><br>> <br><br>> ==================================================<br><br>> <br><br>> Also wondering if anyone has written a paper about X3D and gamma correction - not finding any.<br><br>> <br><br>> Another reference of interest, liberally paraphrased above:<br><br>> <br><br>> * Wikipedia: Gamma correction<br><br>>    <a href="https://en.wikipedia.org/wiki/Gamma_correction" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Gamma_correction</a><br><br>> <br><br>> <br><br>> On 9/1/2020 2:55 AM, Michalis Kamburelis wrote:<br><br>>><br><br>>> It's a great explanation of how and why gamma works in X3DOM :)<br><br>>><br><br>>> It was an inspiration for my own reading about gamma (results on <a href="https://github.com/michaliskambi/x3d-tests/wiki/Gamma-correction-in-X3D-and-glTF" rel="noreferrer" target="_blank">https://github.com/michaliskambi/x3d-tests/wiki/Gamma-correction-in-X3D-and-glTF</a> ) and finally implementation of gamma correction in Castle Game Engine ( <a href="https://castle-engine.io/manual_gamma_correction.php" rel="noreferrer" target="_blank">https://castle-engine.io/manual_gamma_correction.php</a> ).<br><br>>><br><br>>> Note that in CGE I made a bit different decisions than X3DOM:<br><br>>><br><br>>> - 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 <a href="https://castle-engine.io/manual_gamma_correction.php" rel="noreferrer" target="_blank">https://castle-engine.io/manual_gamma_correction.php</a> . I made such default behaviour to keep backward compatibility, otherwise introducing gamma in CGE would change the look of almost all existing models.<br><br>>><br><br>>>      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.<br><br>>><br><br>>> - 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.<br><br>>><br><br>>> Regards,<br><br>>> Michalis<br><br>>><br><br>>> pon., 31 sie 2020 o 22:22 Don Brutzman <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a> <mailto:<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>>> napisał(a):<br><br>>><br><br>>>     Michalis, wondering what you thought about this?<br><br>>><br><br>>>     <a href="https://doc.x3dom.org/tutorials/lighting/gamma" rel="noreferrer" target="_blank">https://doc.x3dom.org/tutorials/lighting/gamma</a><br><br>>><br><br>>>     "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:" [...]<br><br>> <br><br>> all the best, Don<br><br><br><br>all the best, Don<br><br>-- <br><br>Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br><br>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br><br>X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br><br><br><br>_______________________________________________<br><br>x3d-public mailing list<br><br><a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br><br></blockquote></div></div>