glTF improvements (normal scale, camera fix), mixing glTF with X3D using IMPORT / EXPORT

Posted on

normalScale in X3D
IMPORT / EXPORT to connect X3D and glTF
  1. In both glTF and X3D we implement now a feature to “emphasize / deemphasize normal map”.

    In glTF this is in material.normalTextureInfo.scale, in X3D this is in normalScale parameter of Material or PhysicalMaterial.

    The intuitive meaning of it is:

    • value = 1 is the default, regular bump mapping behavior.
    • values < 1 make normal map effect deemphasized (normal vectors in tangent space have XY scaled down, so they go to (0,0,1) in tangent space, as if the normal map was not used). Value = 0 cancels the normal map effect completely.
    • values > 1 make normal map effect emphasized (normal vectors in tangent space have XY larger).

    Demo file is in x3d-tests repo: pbr/enhanced_phong_material/bump_mapping_normalscale.x3dv.

  2. glTF camera import was fixed.

    We mistakenly imported slightly wrong field of view and slightly wrong position. Usually these 2 bugs cancelled each other… almost 🙂

  3. You can now use IMPORT / EXPORT to selectively take (and reuse as many times as you wish) parts of inner glTF models inside outer X3D file.

    I have documented this with details and examples in new section Interoperability with X3D inside our glTF docs.

Start the discussion at Castle Game Engine Forum