maximum number of points drawn?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
ornages
Prole
Posts: 2
Joined: Thu Aug 05, 2010 12:51 am

maximum number of points drawn?

Post by ornages » Thu Aug 12, 2010 7:45 am

Hi!

Is there a maximum number of point objects that may be drawn at the same time?
I get the impression that the engine doesnt allow more than ~1000 calls to love.graphics.point(x,y) per frame. Is that right?

User avatar
Jasoco
Inner party member
Posts: 3651
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: maximum number of points drawn?

Post by Jasoco » Thu Aug 12, 2010 7:52 am

Points? That's where it just draws a pixel, right? I guess it depends on the speed of your computer. Löve can draw a LOT of stuff and still keep a nice 60~FPS. As long as you aren't hoping to draw all 307,200 pixels on a 640x480 screen every frame.

Use a For loop and draw a point every loop. Up the maximum number by a few hundred over time and see how and at what point the FPS drops too low to be usable.

Edit: Sample code to start with:

Code: Select all

for i=1,5000 do
  local r = math.random(0,255/5)*5
  gr.setColor(r,r,r)
  gr.point(math.random(0,799), math.random(0,499))
end
I can get 5500 points drawn at once before I lose FPS. 6000 puts it at 50 and 10000 puts it at 30.

ornages
Prole
Posts: 2
Joined: Thu Aug 05, 2010 12:51 am

Re: maximum number of points drawn?

Post by ornages » Thu Aug 12, 2010 8:04 am

youre right. i think my mistake is that i draw points over points and therefore i cant see them anymore. I want to write a snowglobe where it snows and once the flakes hit the ground, they remain there. therefore i have to update the ground level in integer steps. however the flakes have a given speed which is floating point. once they hit the ground, they are probably overlapping which gave me the wrong impression that they would be cleared at some point.


Heres a fileupload with the program and a more detailed explanation of the problems I'm having:
http://www.2shared.com/file/TVJ5JC_i/Sc ... 0love.html

Post Reply

Who is online

Users browsing this forum: PyroTheWicked85 and 16 guests