Thanks, Christophe, Guillermo and Selden,
for bringing your observations about the galaxy lighting to my attention.
Let me try to explain in words (not code) what I do.
In the rendering code every point of the galaxy templates stores an associated brightness value ranging from 0 to 255. The brightness value of the arms is visible in the gray-level of the template: e.g. for an 'Sa' spiral exhibiting tightly wound arms,
To each such point I associate a centrally peaked small 2D texture (-> a sprite) that smears out the brightness of each base point over a domain of varying size, depending on the size of that sprite. The 3D galaxy shape is modelled by tangentially orienting each sprite to the true 3D shape in each base point. Hence each galaxy element acts itself as a light source. The central region, however, represents a much stronger source of light than the arms, since there I overlaid 6 circular sprites each with the same high brightness.
OpenGL takes additively into account all these light sources. So the region adjacent to the strong central illumination will get additively illuminated both by its own light and that radiated in from the strong sources in the central blob. Shadowing effects are also taken into account automatically in such an OGL approach.
To my opinion similar things happen also with real galaxies, where the spherical central area emitts most light that is also shed onto the nearby parts of the arms and adds to the light directly emitted from the arms (see my above edge-on photos). Towards the periphery, the central light becomes negligible and the emitted light from the arms also gets weaker.
So what is so different in principle between the OpenGL way of illumination and real galaxies?
Fridger
PS:
Perhaps as a further clarification, I have recompiled my code after switching off entirely all light sources of the central blob in m100. The result is attached. You see the weaker light sources in the arms remain and provide an illumination of the galaxy.
and here is again the link to the full image for a direct comparison:
Not a very desirable rendering
