Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Showing many circles (or bitmaps) — Gideros Forum

Showing many circles (or bitmaps)

totebototebo Member
edited January 2016 in General questions
Hi guys, me again! :)

Similar to this thread, which method allows most visible stationary circles or bitmaps at the same time?

Thoughts:

I guess Mesh is out, because a nice circle would take up too many vertices, and you can't use bitmaps as a texture for a group of vertices (right?).

Bitmaps are slow if there are lots of them, but Shapes are also slow, again because a circle Shape would require many vertices/points.

Before I start benchmarking the above methods, are there any ideas out there?

Niclas
My Gideros games: www.totebo.com

Comments

  • Can you use a renderTarget as a texture for a group of vertices? If so just make a renderTarget, draw a circle in there, then assign that to the vertices maybe.
  • Hmm... renderTarget = bitmap, right?
    Also, renderTarget is kind of slow for Gideros, depending on the render size.

    If you want to go with smooth circle(something that look like glowing circle and such), then bitmap is the only option, but if you are okay with aliased, better use shape, it still consume less even with many vertices.
  • piepie Member
    Just throwing in my 2 cents, maybe it's worth a try in your tests :)
    --big circle
    for i = 1, 18 do
    	local shape = Shape.new()
    	shape:setLineStyle(200, 0xff0000)
    	shape:beginPath()
    	shape:lineTo(1, 0)
    	shape:endPath()
    	shape:setPosition(150, 150)
    	shape:setRotation(2.5*i)
    	stage:addChild(shape)
    end
     
    --small circle
    for i = 1, 9 do
    	local shape = Shape.new()
    	shape:setLineStyle(100, 0xff0000)
    	shape:beginPath()
    	shape:lineTo(1, 0)
    	shape:endPath()
    	shape:setPosition(350, 150)
    	shape:setRotation(5*i)
    	stage:addChild(shape)
    end
  • How about Shaders?
  • hgy29hgy29 Maintainer
    I think the most efficient would be a point mesh with appropriate shader, though gideros may lack some API for that.

    You may want to try new Path2D sprite for efficient curve rendering (faster than Shape)
  • SinisterSoftSinisterSoft Maintainer
    edited January 2016
    Some kind of shader that would draw a group of circles based on list of x,y,radius,colour values would be great.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Thanks for the responses guys! Sounds like a job for Path2D. Is that one in officially in the new release @hgy29?
    My Gideros games: www.totebo.com
    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Yes it is!
    +1 -1 (+4 / -0 )Share on Facebook
Sign In or Register to comment.