It would be helpful if lights can be instantiated and destroyed dynamically in runtime. For now, I do not have a clear preference how to achieve this, just see some rough ideas:
- Place a Light as part of a Model (and ModelState?). Each instance of a model (model state) would have own instances of lights.
- Light can become a type in expression language, similarly to "model". They can be declared as types of variables and arrays + there would be a function/component to instantiate a light and another one to destroy it.
... you have maybe some better alternative how to specify dynamic lights.
Dynamic light instances
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
An interesting idea. I am using the GL lights dynamically in my current project,. by simply enabling and disabling a light and changing its position and color as needed. I just use an extra light for FX in short bursts, and this works very well.
I am considering implementing a differed rendering set-up for an unlimited light number,. anyone have an example of this in ZGE??
I just read a good tutorial for setting this up for a 2d game I will look for that link. . ,
I am considering implementing a differed rendering set-up for an unlimited light number,. anyone have an example of this in ZGE??
I just read a good tutorial for setting this up for a 2d game I will look for that link. . ,
iterationGAMES.com
Yes I use the same technique of enabling/disabling and changing positions of lights for a live wallpaper I'm working on now. Apart of other animation, each touch should generate its own light. I have 10 lights included, but maybe some devices allow to have more than 10 touches... Anyway, the code is quite cumbersome and I wanted to have better support in ZGE.jph_wacheski wrote:I am using the GL lights dynamically in my current project,. by simply enabling and disabling a light and changing its position and color as needed.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Here is that post I was talking about,.
http://www.wholehog-games.com/devblog/2 ... a-2d-game/
I intend to make use of more interesting lighting/rendering as I keep making games,. . depending on the gameplay needs and ease of implementing,. lots of interesting bits in there.
http://www.wholehog-games.com/devblog/2 ... a-2d-game/
I intend to make use of more interesting lighting/rendering as I keep making games,. . depending on the gameplay needs and ease of implementing,. lots of interesting bits in there.
iterationGAMES.com