You can run our Castle Model Viewer with --debug-log-shaders command-line
option. Output will show you the final shader code generated,
and also the OpenGL log after linking the shaders.
Be sure to redirect the output to a file as it may be quite large.
This is a useful way to learn about our shader rendering internals.
Another useful option to try in Castle Model Viewer is to switch to
View
→ Shaders
→ Enable For Everything mode.
This will force shader rendering for all the shapes,
while by default we use shader rendering only for the shapes that
require particular effects (shaders by ComposedShader, effects
described in this paper, shadow maps and such).
Forcing shader rendering for everything allows to see
how our shaders implement the whole X3D lighting and texturing model.
It also forces all the lighting calculation to be done per-pixel, resulting
in perfect specular highlights and spot light shapes.