<div dir="ltr"><div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_7066768916742269574m_5824943408832330468m_-7854146766882128111m_3634195750814090840quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
From: Michalis Kamburelis <<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>><br>
To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
Subject: [x3d-public] Support for specular maps (and more) in<br>
        view3dscene, and Blender exporter to CommonSurfaceShader<br><br>
<br>
1. I was working intensively on support of CommonSurfaceShader (aka<br>
"material on steroids") in view3dscene and Castle Game Engine, and the<br>
following features have been added:<br>
<br>
- specular maps (vary specular color throughout the surface, e.g.<br>
making it selectively shiny or "rough")<br>
- shininess maps<br>
- ambient maps<br>
- configuring displacementFactor for parallax bump mapping<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">CommonSurfaceShader is a nice way to get many of the performance and effect benefits of shadering without having to learn glsl and the light models' matrix math. Some time ago I made a bump mapped Earth in x3dom and then wanted to add a displacement map. However, x3dom only allowed displacement in the direction of the <span style="background-color:rgb(249,249,249);color:rgb(51,51,51);font-family:"open sans",calibri,candara,arial,sans-serif;font-size:15px">displacementAxis field, by default y.  This is now changed and displacement is along the normal but only if there is also a normal map (I believe). </span></div><div dir="auto"><span style="background-color:rgb(249,249,249);color:rgb(51,51,51);font-family:"open sans",calibri,candara,arial,sans-serif;font-size:15px"><br></span></div><div dir="auto"><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px"><a href="http://andreasplesch.github.io/x3dom/CommonSurfaceShader/displacement.html" target="_blank">http://andreasplesch.github.<wbr>io/x3dom/CommonSurfaceShader/<wbr>displacement.html</a></span></font><br></span></div><div dir="auto"><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px"><br></span></font></span></div><div><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px">Does parallax bump mapping mean displacement is applied along the local normal ? Do you think it would be beneficial to have a displacementAxis field ?</span></font></span></div><div><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px"><br></span></font></span></div><div><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px;background-color:rgb(249,249,249)">The main issue I had with using displacement maps is their limited fidelity, eg. only increments of 1/255 are possible.</span></font></div><div dir="auto"><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px"><br></span></font></span></div><div dir="auto"><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><span style="font-size:15px"><a href="https://github.com/x3dom/x3dom/issues/591" target="_blank">https://github.com/x3dom/x3dom<wbr>/issues/591</a></span></font><br></span></div><div dir="auto"><span style="background-color:rgb(249,249,249)"><font color="#333333" face="open sans, calibri, candara, arial, sans-serif"><br></font></span></div><div>I think webgl2 allows floating point textures. Did you consider taking advantage of floating point textures ? I think maybe even phones support them.</div><div><br></div><div>Finally, I could not find the displacementTexture field in instant reality : <a href="http://doc.instantreality.org/documentation/nodetype/CommonSurfaceShader/">http://doc.instantreality.org/documentation/nodetype/CommonSurfaceShader/</a></div><div><br></div><div>Not sure, if they want to add it (or perhaps already did).</div><div><br></div><div>I may try to adopt your examples for x3dom,</div><div><br></div><div>-Andreas</div><div><br></div><div><br></div></div>
</div>