3 registered members (AndrewAMD, TedMar, Ayumi),
1,374
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Dynamic light limit
#49095
07/13/05 03:35
07/13/05 03:35
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
I am aware that there is a limit on dynamic lights in a level... so how can I get around that? I am designing a game set at night, which will include, if possible, one or two lights on each vehicle and a light on each trooper, to represent their headlights/torches. How can I do this for two players without overloading the dynamic light limit?
|
|
|
Re: Dynamic light limit
[Re: ]
#49096
07/13/05 03:46
07/13/05 03:46
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Perhaps updating the lights' paths less frequently and turning lights that are invisible or too far away off? What I mean by updating lights' paths less frequently is to have 8 lights to be processed in one frame, the next 8 lights processed in the next frame, then the final 8 in the third frame. After that, update the first 8 lights in the fourth frame, update the next 8 in the fifth, the next 8 in the sixth then update the first 8 again in the seventh and so on. Though I'm not sure how to script it, perhaps using a while loop for processing lights and when 8 lights are done, insert a wait instruction then the next 8 lights follow with another wait instruction like this in a way:
while(1) { light_1_action; light_2_action; light_3_action; light_4_action; light_5_action; light_6_action; light_7_action; light_8_action; wait(1); light_9_action; light_10_action; light_11_action; light_12_action; light_13_action; light_14_action; light_15_action; light_16_action; wait(1); light_17_action; light_18_action; ... wait(1); }
Don't know if this'll work, but you can certainly try it. This idea is only best at slow speeds, but if you have too many lights, you'll need a longer delay and it'll soon become noticeable, especially at low frame rates.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Dynamic light limit
[Re: ulillillia]
#49097
07/13/05 06:46
07/13/05 06:46
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
In the maual it says that there is a limit of 32 dynamic lights- is there a way to bypass that? Making 'fake' dynamic lights?
And if I am using a lot of 'fake' lights, that function might be very useful, thanks.
|
|
|
Re: Dynamic light limit
[Re: ]
#49098
07/13/05 07:07
07/13/05 07:07
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Actually, the hardware limit is 8 dynamic lights and, from what I can tell, an unlimited number of static lights. Using models and sprites might help "fake" dynamic lights to some extent.
As for the function, just replace the light_XX_action with whatever the actions are for your dynamic lights. This way, 8 of them get processed per frame, but, to make best use of it, you'll need a decent or sufficient frame rate or you may notice the "faking" of it.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Dynamic light limit
[Re: mk_1]
#49100
07/13/05 11:28
07/13/05 11:28
|
Joined: Jun 2005
Posts: 54
iWaNtToKnOw
Junior Member
|
Junior Member
Joined: Jun 2005
Posts: 54
|
i think it is possible to make Fake Lights like HL1 FlashLight using a bitmap with alpha channel and the Texture to be iluminated and make a Decal, but is very hard and complicated, need some shader knowledge, try use something like this in models headlights.
Tell Me, iWaNtToKnOw!
|
|
|
Re: Dynamic light limit
[Re: ]
#49101
07/13/05 11:43
07/13/05 11:43
|
Joined: Aug 2000
Posts: 7,490
Orange Brat
Senior Expert
|
Senior Expert
Joined: Aug 2000
Posts: 7,490
|
You can have more than 8 lights per level...you just can't have more than 8 on at once. However, having that many lights on at once is a framerate killer in certain circumstances. I like to keep it under 4-5 in a single view. Try out my dynamic light code...it takes care of most circumstances including shutting lights on/off if you desire: http://www.coniserver.net/ubbthreads/showflat.php?Cat=&Board=UBB3&Number=536372Quote:
In the maual it says that there is a limit of 32 dynamic lights-
That's a relic from the A5 days. I think Conitec had their own engine trick and could display that many, but they weren't hardware lights. I recall a lot of people hated the switch to hardware lights and actual prefer the old software look. Anyway, that shouldn't be in the manual anymore unless you're using an old one. Get the newest in the Blame the Manual forum.
My User Contributions master list - my initial post links are down but scroll down page to find list to active links
|
|
|
Re: Dynamic light limit
[Re: Orange Brat]
#49102
07/13/05 12:08
07/13/05 12:08
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
Expert
|
Expert
Joined: Oct 2003
Posts: 4,131
|
Quote:
8 lights to be processed in one frame, the next 8 lights processed in the next frame, then the final 8 in the third frame.
this is a very bad idea.. this will make all of your light flicker..ugly. Bascially you cant get around the 8 light limit yet, so dont try, just design around it..instead of using 2 lights for each car headlights, just use one for each car. of course, only activate lights that are near to the camera, and can easlity fade them in and out..when you think about it, 8 lights at once is an awful lot of lights, more than you should reasonably need.
|
|
|
Re: Dynamic light limit
[Re: Matt_Aufderheide]
#49103
07/14/05 02:17
07/14/05 02:17
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
Well, in a tank battle at night, you might have 5-10 tanks per side, each with a headlight. So it would be possible to just turn off lights that aren't seen at a given point in time?
|
|
|
|