Tweak the particle system in demo2
Update demo8 and document shadow volume visibility test bugs

Update demo8. Add lights casting shadows through the gratings and remove the
light inside the user-controller object.

Update the README to reflect two shadow volume bugs visible in demo8:
A large grating shadow overlaying the window probably as a result of a
missing darkcap from the shadow volume cast by a corner light. This
is a problem with the shadow volume visibility test, and disabling
the the test fixes it. Additionally, the grating shadow from the
nearby light can disappear; this is also fixed by disable the test.

Another occasional problem is an error message relating to unexpected
number of shadow pyramid sides (shadow volume pyramid cones are
generated for point source lights). This occurs in demo8, and can
ocassionally be seen in demo8.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Make per-geometry light scissors the default in the demos

Geometry scissors are now the default light scissors setting
when starting a demo scene with sre-dmo. Geometry scissors
already were the library default scissors setting.

Per-geometry light scissors provide a noticeable performance
improvment in many complex scenes with a large number of local
lights, and the implementation seems to be relatively stable. The
only drawback is a little more CPU utilization (generally only
an issue on very slow processors like pre-Cortex ARM).
Split and clarify shadow volume visibility tests

The two shadow volume visibility tests (for a shadow volume
cast by object delimited by the light volume, and for the darkcap,
the infinite projection of a pyramid or similarly shaped shadow
volume of a point light source), can now be seperately enabled
and disabled.

The darkcap test is disabled by default, due to bugs. It can be
disabled/enabled using the keyboard interface in the back-end
(keys X and C).

Additionally, this commit also makes working the GUI keyboard
option to force depth-fail stencil shadow volume rendering.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Split lights.cpp and split bounding_volume.cpp, and fix bugs

Move the geometrical shadow volume calculation functions from
lights.cpp to shadow_bounds.cpp. Move a few bounding box related
functions from lights.cpp to bounding_volume.cpp and into the
sreBoundingVolumeBox class.

Split off the intersection tests in bounding_volume.cpp into
intersection.cpp.

When calculating shadow volume scissors, detect when the shadow
volume is not a pyramid cone. Scissors calculation for other
volume type is not yet implemented, but the error messages
and possible related rendering errors are eliminated.

Rename a few sreScissors inline class member functions, and
improve the function calculating a scissors region from a
pyramid with a more informational return value.

Improve the dependencies in the Makefile.

Update to README.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Rework and improve geometry scissors; fix spotlight shadow volume

Overhaul the geometry scissors implementation, especially the
geometry scissors cache, adding code to maintain consistency when
some lights are skipped early. This addresses potential errors
when the frustum hasn't changed to existing visibility data is to
be used. When a light has a variable light volume, but has defined
worst case bounds, it is now included in the visibility lists based
on the worst case bounds, and can be skipped when the actual volume
is not visible, while entries in the object geometry scissors
caches for the light will have been reserved when the frustum
changed so that they can be filled in when the light moves into the
frustum.

There is room for optimization, since the solution above may
increase CPU utilization. One improvement would be to detect when
the frustum is changing every frame (common occurence when the
viewpoint is moving), and in that case omit any geometry scissors
cache preparation and storage; only when the frustum becomes
stationary for two or more frames would the scissors caches be
initialized for use in subsequent frames with unchanging frustum.

Some variable name have been changed (e.g. the aray of static
objecst within a static light volume has been renamed from
visible_object to light_volume_object) and some comments edited.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Fix shadow volume bounds calculation for spotlights

Fix the shadow volume bounds calculation for spotlights
by using the actual range as radius when constructing
the pyramid cone; it was erroneously using the bounding
sphere radius which for a spotlight is not centered
at the spotlight position.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>