Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
How to make rendering prettier?
This page is the opposite of the manual page How to optimize your games :)
Use bump mapping (by
Appearance.normalMap). In general, use
CommonSurfaceShaderwith various optional texture slots it offers: diffuse texture, specular texture, emissive texture, normal map etc. See ComonSurfaceShader documentation. Our Blender exporter can export X3D or castle-anim-frames files with the
CommonSurfaceShadernode set up.
Set shading to Phong. You can set shading per-shape, but usually it's easier to just set
Scene.Attribtues.PhongShading := truefor the whole scene (TCastleScene instance).
Note that Phong shading is activated automatically (for a particular shape) when you use bump mapping or shadow maps or some other engine effect. So you may not need to actually request it explicitly.
Turn on SeparateDiffuseTexture. This makes lighting calculation prettier, as the diffuse texture really affects only the diffuse lighting term, and it doesn't affect e.g. specular highlights.
SeparateDiffuseTexturewill be the default in Castle Game Engine (after some major release version bump, like 7.0 or 8.0). But we want to optimize them more before doing this.
Use post-processing, called "screen effects" in our engine: https://castle-engine.io/x3d_extensions_screen_effects.php
Coming soon: You will be able to use physically based rendering (PBR), see my plans.