<div dir="ltr">> If you put an x3dom version on github, it makes it easy to collaborate.<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
<br>
Done -- inside <a href="https://github.com/castle-engine/demo-models/tree/master/common_surface_shader/x3dom" rel="noreferrer" target="_blank">https://github.com/castle-<wbr>engine/demo-models/tree/<wbr>master/common_surface_shader/<wbr>x3dom</a><br>
</blockquote><div><br></div><div>Very nice. I forked and updated the examples in cors branch to use https and a x3dom crossOrigin field for loading the textures with rawgit. As a result the examples now are live on these rawgit links:<br><br><a href="https://github.com/andreasplesch/demo-models/blob/cors/common_surface_shader/x3dom/live_links.md">https://github.com/andreasplesch/demo-models/blob/cors/common_surface_shader/x3dom/live_links.md</a><br><br></div><div>for example:<br><br><a href="https://rawgit.com/andreasplesch/demo-models/cors/common_surface_shader/x3dom/leaf.html">https://rawgit.com/andreasplesch/demo-models/cors/common_surface_shader/x3dom/leaf.html</a><br></div><div><br></div><div>It is probably worth filing x3dom github issues for identified bugs or missing or wrong behaviours.<br></div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">.<br>
<br>
Note that I moved the examples, from<br>
bump_mapping/common_surface_<wbr>shader/ to just common_surface_shader/ .<br>
The links everywhere should be updated now.<br>
<br>
Various options seem unsupported by the X3DOM, I placed some comments<br>
in the X3D code inside.<br>
<br>
As for the displacement:<br>
<br>
- I see that I misjudged the meaning of displacementFactor in X3DOM.<br>
By default it really makes a large 255 displacement. (In my<br>
implementation, I initially assumed it should be divided by / 255.0.)<br>
<br>
- As you wrote, the X3DOM indeed actually displaces the vertexes,<br>
along the normals, and the "displacementAxis" seems ignored for this.<br>
<br>
- I decided that trying to "reuse" the "displacementFactor" field for<br>
my parallax effect could be more confusing than helpful for users.<br>
What I'm doing ("parallax bump mapping effect") is visually different<br>
than what X3DOM is doing ("actually displace vertexes"). Trying to<br>
control it with the same parameter like "displacementFactor" was not<br>
so helpful as I initially imagined, because for the parallax bump<br>
mapping, the sensible values are around 0.01 - 0.1 (larger things<br>
quickly look weird).<br>
<br>
  Especially since for now Castle Game Engine expects to find the<br>
height map in the alpha channel of normal map, so we ignore the<br>
"displacementMap"...<br>
<br>
  So, I changed my implementation, to not look at the displacementFactor at all.<br>
<br>
  I will use "displacementMap" and "displacementFactor" only when I<br>
will *actually* use them for displacement of vertexes, compatible with<br>
X3DOM. For the current effect, I added my own field<br>
"normalTextureParallaxHeight" (default 0). When<br>
normalMapParallaxHeight <> 0, then CGE will look for a height map<br>
inside normalTexture alpha channel, and use it for parallax.<br>
<br></blockquote><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  Blender exporter was updated to write both "displacementFactor"<br>
(helpful for X3DOM users) and "normalTextureParallaxHeight" (helpful<br>
for CGE users).<br>
<br>
Best regards,<br>
Michalis<br>
</blockquote></div><br></div><div class="gmail_extra">thanks ! Andreas<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div>