Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Quick sprite instances — Gideros Forum

Quick sprite instances

olegoleg Member
edited November 2019 in General questions
Tiles work very fast, but tiles have disadvantages:
-Tiles should be square in shape
-Tiles cannot be animated
-Tiles can only be placed on the grid

What is the best way to make copies of objects?
I make copies using Viewport() -But it's still slower than tiles. Is there any quick method to do instances?
Maybe this can somehow be done at api level?
my games:
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!

Comments

  • hgy29hgy29 Maintainer
    Instancing isn't available yet, and will require ES 3...
  • hgy29 said:

    Instancing isn't available yet, and will require ES 3...

    Ie the fastest method now is viewport ??
    function clon(sprite,x,y)
     
    local spr=Viewport.new()
    	spr:setPosition(x,y) 
    	spr:setContent(sprite)
    	return spr	 
     
    end
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    Viewport is fastest in the sense that it reuses internal sprite structures and GPU resources, but there is no benefit in terms of scene processing. Particles could be used for simple colored/textured rectangles, but not for generic objects. Instancing will, however, allow to submit for rendering several times the same object with different transforms in a single GPU call, which will be way faster.

    Likes: oleg, antix

    +1 -1 (+2 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Accepted Answer
    Instancing will be able in next Gideros release for Mesh. Since it needs a custom shader, it was better to start with bare meshes implementation.

    Likes: oleg, SinisterSoft

    +1 -1 (+2 / -0 )Share on Facebook
  • hgy29 said:

    Instancing will be able in next Gideros release for Mesh. Since it needs a custom shader, it was better to start with bare meshes implementation.

    When will the release be? , I want to play with the new features of the magnetic sensor!
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
  • hgy29hgy29 Maintainer
    As soon as I manage to make newest build work (currently latest emscripten release broke it).

    Likes: oleg, SinisterSoft

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.