How To Make Rendering Prettier

glTF model from Sketchfab

This page is the opposite of the manual page How to optimize your games :)

  • Use Physical-Based Rendering (PBR).

    The easiest way to use PBR is by using glTF format for your assets. glTF by default uses PBR materials. You can design and export glTF with PBR e.g. using Blender.

    You can also read about PBR in X3D. In short: Michalis has designed PBR in X3D 4 to match glTF PBR exactly.

  • Use bump mapping. In Blender, just set a normalmap texture (texture that affects normal vectors) and export to glTF.

    Internally we do bump mapping by Material.normalTexture or PhysicalMaterial.normalTexture X3D fields.

  • Use other textures (occlusion texture, emission texture, specular and shininess texture (Phong), metallic/roughness texture (PBR)) to provide interesting features varying over the surface.

    See Material (Phong) or PhysicalMaterial (PBR) in X3D 4 for various optional texture slots to affect various additional material parameters.

  • Use screen effects (post-processing).

  • Use effects like mirrors and shadows.

  • Use animation blending when appropriate. To do this, set TCastleScene.DefaultAnimationTransition to non-zero on your scene, or use PlayAnimation with TPlayAnimationParameters.TransitionDuration set as non-zero.

  • Use linear color space. It is automatically used with PhysicalMaterial, so it is automatically used with glTF models using PBR. You can set ColorSpace := csLinear to just use it always (also with Phong lighting or unlit materials).

    This makes calculations more correct with respect to reality. This should be turned "on" from the begging of working on your graphic assets — as it necessarily affects to colors of everything.

  • Try and use one of the tone mapping options if you feel they improve your colors.


To improve this documentation just edit this page and create a pull request to cge-www repository.