Inspired by StevenM's great work on OpenGL lights in
this thread I decided it was finally time to attempt bringing more control over lights to ZGE.
Here's a list of the things that's been added:
App.Lights - This is a list that can hold the new Light-component. If this list is empty then the single-light model is active and App.LightPosition is used just like before. You can put several lights in this list (OpenGL guarantees support for 8 lights).
App.AmbientLightColor - This is the global ambient light value. Previously this has been hard-coded at 0.4, 0.4, 0.4 (which is now the default value for this property).
Light-component
- Position
- DiffuseColor,AmbientColor,SpecularColor
Material
- SpecularColor, EmissionColor
- Shininess - Allowed range is 0-127.
For more info on how to use these properties see these threads:
http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml
http://www.falloutsoftware.com/tutorials/gl/gl8.htm
Please note that this is almost not tested at all. I'd appreciate if someone could create and share a test-project for these new features to help me fix bugs that most likely exists in my implementation.
Also your existing projects should not be affected because I've designed this to be 100% backward compatible. If you experience any changes anyway let me know.
New beta can be downloaded here:
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
...and let me also take this opportunity to wish everyone a merry Christmas