Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / DBP only supports 8 lights?

Author
Message
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 20th Apr 2010 14:34 Edited at: 20th Apr 2010 14:39
why would you want to display so many lights at once? this is a killer on performance.... you guys know that right? And you dont want to limit the amount of people that can play your game...
eg. i do not have more then 8 lights on my pc and it is wrong to think that everyone has a fast pc with a sweet graphics card. cause most people do not.

Just cause your machine has 30 lights er whatever doesnt mean you should use them all.

Its a good idea to use a few of them and do what vanb said in the beginning.... use an array of where the lights are in the scene x30 or whatever and turn on 8 at a time that are the closest to the camera.

If you cant figure out how to manage the lights like this.... tgc has a addon that manages this for you..... 1 of those plugins they released.

edit:its called DarkLights

Development & Editting
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2010 15:04 Edited at: 20th Apr 2010 15:05
Quote: "Just cause your machine has 30 lights er whatever doesnt mean you should use them all."

Quite right but like ALL games it's good to allow the highest spec PC to run as well as possible as well as the lowest (within reason)!!

Don't confuse people wanting to know and achieve the full possibility of their game with elitism...

...and Dark Lights is a lightmapper...

SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 20th Apr 2010 15:46
oh.... what plugin managed the light system..... 1 of those they have listed....

Development & Editting
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2010 15:58 Edited at: 20th Apr 2010 17:19
I think it's in eXtends...

I haven't got it installed right now and actually I haven't used it as I have my own system (posted somewhere in its early stages) but if someone else knows the commands?

...just checked it's here in eXtends:
http://www.thegamecreators.com/?m=view_product&id=2080

EDIT: I decided to install eXtends and give it a try. The light system is really easy to use and will massively improve the game I'm working on at the moment!! Better than my own system for the 'nearest light' and I can adapt it to get it working with some of my other lighting stuff (such as adaptive shadow positioning)

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Apr 2010 17:17
I was thinking it's extends, it uses a similar technique to what we'd all do anyway.

I would make a code version, then only check for non-root distances for speed, maybe even check each light in turn so there's only 1 check per loop. I'm thinking that distance might not be the best indicator - you might have 4 flood lights outside a building, and 5 desk lamps inside - so having the extra control over internal and external lights is worth it. I'd have a system where lights are only active within a bounding cube, so buildings internal lights can be ignored when outside. Without a precaution like that - well you'd probably loose a flood light, and those flood lights may be much more important than any internal lights.

I think the best thing is just to be prepared to get your hands dirty - like making your own light handling, it's only with that sort of attitude that you can actually improve on things. You could have lights flicker for instance with your own lighting handling, change colour - maybe a light source changes colour and direction randomly, red and orange and you have cool fire lighting.


Health, Ammo, and bacon and eggs!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Apr 2010 17:21 Edited at: 20th Apr 2010 17:39
Quote: "I think the best thing is just to be prepared to get your hands dirty - like making your own light handling, it's only with that sort of attitude that you can actually improve on things. You could have lights flicker for instance with your own lighting handling, change colour - maybe a light source changes colour and direction randomly, red and orange and you have cool fire lighting."

I hate it when you have a point...

Shouldn't you be promoting your products though...?

EDIT: Looking further into the commands it's not as inflexible as you might think. You can Add/Delete lights as and when you need to or just put them all in and use "L3D Lock Light LightNumber" to lock lights and its counterpart to unlock them depending on whether they are indoor/outdoor/visible or whatever you code them to be... You can also set the color etc. of the lights manually (after checking if they are on/off I suppose) as they are only DBP lights anyway!

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Apr 2010 18:31
Quote: "why would you want to display so many lights at once? this is a killer on performance.... you guys know that right? And you dont want to limit the amount of people that can play your game...
eg. i do not have more then 8 lights on my pc and it is wrong to think that everyone has a fast pc with a sweet graphics card. cause most people do not"


You a right !!, and probably we don`t need any light if we use lightmaps. What my litle example do, is just turn on and of the lights whyle you are clouse to it...then I casully realize that not only eight lights where on. Any way you can do as Van B suggest and make so many lights as you need or perhaps make just eight lights and then make a function that re-position lights wherever you go (an array)....at the end all of us agree

cheers.

I'm not a grumpy grandpa
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Apr 2010 19:17 Edited at: 20th Apr 2010 19:18
If you use a shader, you can get infinitely many lights, and still run faster than using 8 DBPro lights...

Since you can set different shader parameters for each object, you can pick 'x' of the most important lights for each object. After you reach about 3 lights per object you probably won't notice any more, especially if the first 3 are the most important ones.

As long as you split up your scene into objects sensibly, you should be able to get more lights than you would ever need on-screen at once

Bloodknight
16
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 23rd Apr 2010 05:01
I was always under the impression that the number of lights was based on each face, so that each triangle in a rendered scene can only handle lighting from 8 lights, and using more could produce artifacts simply because the light selection algorithm sometimes chose different lights for adjacent faces.

Also, i will think you might find that the magic '8' was a OpenGL limitation originally, and was maintained simply to keep an unwritten standard working so that scenes could be rendered in either OpenGL or DirectX.

Programming of all kinds has been held back for the reason of backwards compatability for decades, check how long 8086 chip code has been in intel chips for example
Nerd In Training
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 24th Apr 2010 15:59
Quote: "What do you have to type to get the lights to work. This is what I have so far."

What I meant was I am using Cartoghy Shop and whanting to load it up on DBpro, but it's not working. The lights aren't there. Here is the code I'm using


If x=y then we're all doomed.
WickedVixen
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 24th Apr 2010 17:02
With the quickie game lights test program (from chafari), I get 18. That's on my HP Pavilion dv6000! (Intel Centrino Duo, Nvidia 850M GS graphics card, Win7 Pro...)

Anyway, it seems that it's strictly a gfx card issue-- update your drivers and see if that changes it... If not, (for desktops) upgrade your gfx card! For laptops, use it to develop with mobility as a focus-- scale down your levels for laptop use (or as suggested before) just the lights you need for the player's location...

Seems a simple fix...

Good luck on whichever way you choose...
Cheers.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Apr 2010 19:51
@Anitarquious I
Yeah...nowaday, most new computers(laptot/desktop) are capable of show 18 lights a at time, but unfortunatelly old computers don`t show more than 10...or ever 8 lights.So we had better try a new method of lighting to asure that our games will run in all PC.

Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-27 00:53:57
Your offset time is: 2026-07-27 00:53:57