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.

Newcomers DBPro Corner / GET MAXIMUM LIGHTS() Error

Author
Message
Algae Man
21
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
Posted: 6th Jul 2003 00:33
I am new to DarkBAsic Pro, and was interested by something it said in the manual. It said that the number of lights you can have at one time is dependant on your accelerator card. DBC could have only a maximum of 7 lights, so I wanted to see if I could now have more. I used the function GET MAXIMUM LIGHTS() and it returned -1! Has this happened to anyone else? Is this a bug, or is it just my system?
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 6th Jul 2003 01:49
8
but you should try to make several lights and look if it works

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 6th Jul 2003 23:21
for i=1 to 50
make object sphere i,rnd(10)
position object i,rnd(50),rnd(50),rnd(50)
next i
autocam off
point camera 25,25,25
for i=1 to 1000
make light i
color light i,rgb(rnd(255),rnd(255),rnd(255))
position light i,rnd(100),rnd(100),rnd(100)
set light range i,300
repeat
a$="Light number: "+str$(i)
text 200,200,a$
sync
until upkey()
wait 100
for l=1 to i
if (light exist(l) <>1) then text 200,300,"light missing"
next l
next i

I gave up at 240 ????, anyone care to try this?

Mentor.

the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 6th Jul 2003 23:40
I think almost all cards have 8 hardware lights.
It returns 8 on mine, are you using the demo version of dbpro it has a fair few bugs.
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 7th Jul 2003 01:54
Mentor, I got up to 1000 using that code. Get maximum lights() returns 8 on my computer, I've heard of people getting -1 before, but can't remember why.

Once I was but the learner,
now, I am the Master.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 7th Jul 2003 15:19 Edited at: 7th Jul 2003 15:21
I suspect it is re-using lights but why does the check never flag any lights as not used?, I am sure if my card was trying to render the effects of 1000 lights all at the same time then fps would be down to .02 per second , seems like the values are just rolling over and there is no limit check in the function (or it uses get maximum lights to work out the limit), so you get up to 8 lights and then it rolls over (ie: 9=1 10=2 11=3 etc) but I still can`t figure why light exist says the other lights exist, unless that is rolling the values over too, either that or some people realy can have 1000 lights .

Mentor.

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 7th Jul 2003 18:00
Probably because "make light" sets-up all the parameters for your light in the scene (position, colour, type, etc). So yes you can have as many as you like, in a way it's just setting them all up ready for use. The limit is in how many of them are actively visible at once, typically 8.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
New DBS Web Sites Coming Soon - All Change

Login to post a reply

Server time is: 2024-11-10 11:57:56
Your offset time is: 2024-11-10 11:57:56