<div dir="ltr"><div><div><div>While exploring differences in rendering between x3dom and cobweb using<br><a href="http://andreasplesch.github.io/Library/Viewer/x3dweb.html">http://andreasplesch.github.io/Library/Viewer/x3dweb.html</a><br></div>it becomes quickly obvious that materials in cobweb tend to appear darker with more contrast. For example the material used in the example scene below looks more like copper on my screen in x3dom but golden in cobweb.<br></div>This difference can be traced back to the use of gamma correction for lighting purposes in x3dom introduced here:<br><a href="https://github.com/x3dom/x3dom/issues/222">https://github.com/x3dom/x3dom/issues/222</a><br></div>and further discussed here:<br><a href="https://github.com/x3dom/x3dom/issues/487">https://github.com/x3dom/x3dom/issues/487</a><br><div><div><div><div><div><br>From what I understand the main point is that although colors in image files and materials are already gamma encoded and do not need special treatment for decoding to display on a typical screen, when it comes to lighting well known equations assume that colors and their intensities are provided in a linear (non gamma encoded) space. This means that colors in lighting need to be decoded (linearized) first, then light processed, and finally re-encoded for delivery to the display system. x3dom does that by default and has a special environment node attribute to switch off this kind of gamma treatment (gammaCorrectionDefault="none"). Switched off, x3dom looks very similar to cobweb; a look which perhaps some regard as more traditional (?).<br></div><div><br>These differences point to a need to standardize gamma treatment since currently the standard seems quiet and allows for quite different interpretations of how lighting equations are applied.<br><br>On the other hand, it may well be that it is out of the scope of the x3d
 specification to be more precise about how colors should appear. After 
all, the trend is to custom shaders which do their own processing 
anyways. Is there a newer or emerged standard shading/material model 
replacing the current (Phong?) shading ?<br><br></div><div>As a first step it would be necessary to determine what assumptions the lighting equations given in the current standard make in order to claim that they are somewhat realistic. Are these equations opengl derived ?<br></div><div>Another question is if any other x3d browsers attempt some kind of gamma correction for shading purposes.<br></div><br>-Andreas<br><div><br></div><div>Here is a short example scene, ready to use:<br><font size="1"><span style="font-family:monospace,monospace"><br></span></font></div><div><font size="1"><span style="font-family:monospace,monospace"><?xml version="1.0" encoding="UTF-8"?><br><!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "<a href="http://www.web3d.org/specifications/x3d-3.0.dtd">http://www.web3d.org/specifications/x3d-3.0.dtd</a>"><br><X3D profile='Interchange' version='3.0'  xmlns:xsd='<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>' xsd:noNamespaceSchemaLocation =' <a href="http://www.web3d.org/specifications/x3d-3.0.xsd">http://www.web3d.org/specifications/x3d-3.0.xsd</a> '><br><head><br><meta name='title' content='Figure03.08DefaultSphere.x3d'/><br></head><br><Scene><br>  <Background groundcolor='0 0 0' /><br>  <NavigationInfo headlight="false" /><br>  <!-- uncomment to disable gamma correction in x3dom --><br>  <!--<br>  <Environment gammaCorrectionDefault="none"></Environment><br>  --><br>  <DirectionalLight direction="0 0 -1" /><br>  <Viewpoint position="0 0 3" orientation="0 0 0 1" /><br><Shape><br><Sphere /><br><Appearance><br><Material<br>              ambientIntensity='0.25'<br>              diffuseColor='0.384722 0.266993 0'<br>              specularColor='0.757576 0.738847 0.590386'<br>              shininess='0.0666667'/>      <br></Appearance><br></Shape><br></Scene><br></X3D></span></font><br clear="all"><br>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div></div></div></div></div>