New features: KTX (Khronos texture format), nvcompress, X3D helpers…

Posted on


As a little break from the work on Delphi compatibility, I added some new features to the engine 🙂

  1. KTX (Khronos Texture format) support throughout the engine. See the details about KTX features supported. KTX format is in many ways an alternative to DDS, with a clean specification, supporting the same features (GPU compression, 2D and 3D textures…). The KTX Khronos page has links to various tools that can create KTX files.

    You can test it now by downloading glViewImage 1.7.0! Sample KTX files are e.g. inside official KTX repository.

  2. Support nvcompress for automatic compressing of textures for GPU.

    nvcompress is part of the NVidia Texture Tools. It is cross-platform (Windows, Linux…), free and open source. On Debian and derivatives (like Ubuntu) you can install it simply by apt-get install libnvtt-bin. Thanks to Eugene Loza for advicing it!

    The nvcompress will be automatically used underneath when you call castle-engine auto-generate-textures in your project. This requires using our build tool to manage your game project.

  3. Our fps_demo shows how to easily get texture compression in your games. See the material_properties.xml in fps_game for how to trivially compress your textures to DXT1 and DXT5. See material_properties.xml and texture compression documentation for more information.

    There was also an important fix to using this approach for textures referenced from X3D.

  4. Useful helpers for X3D building, to easily create and modify X3D graph:

    • New methods AddChildren, RemoveChildren for grouping nodes (like TTransformNode, TGroupNode).
    • New methods CreateShape, CreateTransform for geometry nodes (like TBoxNode, TIndexedFaceSetNode).
    • Also on geometry nodes: Coord, FogCoord, TexCoord and some more are now simple properties.
    • SetXxx methods available to set various multiple-value (array) fields. Use them like this:
      Coord.SetPoint([Vector3(...), Vector3(...)]);
      IndexedFaceSet.SetCoordIndex([0, 1, 2]);

      These look much better than

      Coord.FdPoint.Items.Assign([Vector3(...), Vector3(...)]);

      and they always cause an appropriate update (they automatically will call Changed for you, and send the new value using X3D events).

    This is all part of my ongoing effort to enable you to operate on X3D graph more comfortably, without accessing “somewhat-internal” fields instances in FdXxx (like FdChildren, FdCoord…).

  5. Improved and simplified lets_take_a_walk example (examples/3d_sound_game/).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.