This implements the proposal made in the forum for "shiny" materials -
material can now determine the angle at which the most light is reflected.
Shiny materials might set this lower to approximate a "reflection" effect,
and increase the "spottiness" at the same time. To compensate for the
lack of brightness without light, "emittance" can be used.
Not sure this is the most elegant way to model this - the "proper" way
here would be to have emittance, shading and specular as three separate
light parameters instead of molding one into the other and using the third
to compensate.
Furthermore, this reorganises shaders in a major way: We reduce the
number of shader files down to three, pushing a number of possible
configurations into preprocessor. I believe this should be easier to
understand, which for the moment trumps theoretical extensibility
benefits.
In comparison to the old system, this is a downgrade - instead of being
able to set a full color mapping by gamma ramp, we now get just a value
per colour channel.
Upside is that we do not need to play around with the global gamma ramps
any more, which was arguably the wrong way to do it.
This commit will likely break everything that has been using gamma so far.
This is now a "mix" between the original and the alternate drawing
strategy, hopefully combining its strength. In detail:
1. Intensity of light sources aren't added together anymore. Instead,
the brightest light source decides end brightness pre-smoothing.
2. For smoothing, we update normals more quickly than brightness. This is
the main change relative to the first "alternate" version. Actually
quite embarassing that I didn't think of this solution before %)
This is still a tad busier than what we have currently, simply due to
normals changing around more quickly. On the plus side, Clonk faces
shouldn't go dark anymore while walking, so that's something.
Currently, all music pieces are kept in memory to avoid random group access, which is a bit excessive for the larger music pack. This change will allow runtime music loads without too much delay.
- exchanged missing function for FindLocation
- creature owner only if NO_OWNER before
- added area-parameter to Chippie_Egg::Place)
- creature control: don't break when object is removed after creation
Animals should use SetCreatureControlled() and Find_OCF(OCF_Alvie) and Find_Hostile in their prey checks. Then, a scenario author could easily decide to make certain animals not attack the player. Or even animals attack each other. That's cool.
The shapes library has such pointer chains. The leaks were getting pretty heavy because they included pointers to C4AulFuncs, which kept a lot of parts of the script engine and string tables in memory.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
Instead of doing the transformation when drawing a mesh. This allows making
the OpenGL normal matrix more consistent, since it does not include the
Ogre-To-Clonk transformation, and so that the transformation does not need
to be inverted in the shader.
As a side effect, all Attach transformations were updated, since before
they were specified in the OGRE reference frame, not the Clonk reference
frame.