as3 starling rendertexture vs meshbatch [how to make a choice]

199 views Asked by At

Im new to starling and game development in general. As i have understood so far, the two optimised techniques of rendering on mobile are "RenderTexture" and "MeshBatch". - At an architectural level, how should we choose between the two? - Is it also possible to use both simultaneously? (eg. drawing a meshbatch inside a rendertexture)

1

There are 1 answers

0
Alexander Mokretsov On

Those are two orthogonal concepts. You can utilize both simultaniously in your projects. Furthermore, this is related to any platform, not just mobile. You don't have to make a choice, use both.

Render textures
This is not a direct optimization, it is an object used to implement particular effects or rendering techniques. However, it can be used to optimize away some draw calls if you draw complex object to the render texture once and then draw that texture directly to the screen in subsequent frames. Starling implements this optimization for filters.

Mesh batching
This is an actual optimization techique. Draw call overhead can be high, so combining several meshes into one can give some performance benefits if implemented correctly. Starling does this automatically for it's display objects.