Dynamic light instances

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Dynamic light instances

Post by Rado1 »

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.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

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. . ,
iterationGAMES.com
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

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.
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.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

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.
iterationGAMES.com
Post Reply