[x3d-public] Support for specular maps (and more) in view3dscene, and Blender exporter to CommonSurfaceShader

Andreas Plesch andreasplesch at gmail.com
Sun Apr 30 16:48:44 PDT 2017


> If you put an x3dom version on github, it makes it easy to collaborate.

> >
>
> Done -- inside https://github.com/castle-engine/demo-models/tree/
> master/common_surface_shader/x3dom
>

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:

https://github.com/andreasplesch/demo-models/blob/cors/common_surface_shader/x3dom/live_links.md

for example:

https://rawgit.com/andreasplesch/demo-models/cors/common_surface_shader/x3dom/leaf.html

It is probably worth filing x3dom github issues for identified bugs or
missing or wrong behaviours.


.
>
> Note that I moved the examples, from
> bump_mapping/common_surface_shader/ to just common_surface_shader/ .
> The links everywhere should be updated now.
>
> Various options seem unsupported by the X3DOM, I placed some comments
> in the X3D code inside.
>
> As for the displacement:
>
> - I see that I misjudged the meaning of displacementFactor in X3DOM.
> By default it really makes a large 255 displacement. (In my
> implementation, I initially assumed it should be divided by / 255.0.)
>
> - As you wrote, the X3DOM indeed actually displaces the vertexes,
> along the normals, and the "displacementAxis" seems ignored for this.
>
> - I decided that trying to "reuse" the "displacementFactor" field for
> my parallax effect could be more confusing than helpful for users.
> What I'm doing ("parallax bump mapping effect") is visually different
> than what X3DOM is doing ("actually displace vertexes"). Trying to
> control it with the same parameter like "displacementFactor" was not
> so helpful as I initially imagined, because for the parallax bump
> mapping, the sensible values are around 0.01 - 0.1 (larger things
> quickly look weird).
>
>   Especially since for now Castle Game Engine expects to find the
> height map in the alpha channel of normal map, so we ignore the
> "displacementMap"...
>
>   So, I changed my implementation, to not look at the displacementFactor
> at all.
>
>   I will use "displacementMap" and "displacementFactor" only when I
> will *actually* use them for displacement of vertexes, compatible with
> X3DOM. For the current effect, I added my own field
> "normalTextureParallaxHeight" (default 0). When
> normalMapParallaxHeight <> 0, then CGE will look for a height map
> inside normalTexture alpha channel, and use it for parallax.
>
>


>   Blender exporter was updated to write both "displacementFactor"
> (helpful for X3DOM users) and "normalTextureParallaxHeight" (helpful
> for CGE users).
>
> Best regards,
> Michalis
>

thanks ! Andreas

-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170430/d565d2e3/attachment.html>


More information about the x3d-public mailing list