In my game, I have about 50 filled-circles with different size and different color distributed full screen, and they continuously resize themselves, creating animation. I'm currently using Shaperenderer to render all of them. This way, all the circles look crisp but it seems like the performance is not very good. Should I make a circle sprite and then render all of them using SpriteBatch instead of Shaperenderer? Will the performance be improved by doing that?
Drawing simple shapes, which is more efficient: Shaprenderer or SpriteBatch?
581 Views Asked by Hải Phong At
1
There are 1 best solutions below
Related Questions in OPENGL
- setting OpenGL version in objective-C
- How to run OpenGL version 3.3 (with Intel HD 4000) on Ubuntu 15.04
- Can linear filtering be used for an FBO blit of an MSAA texture to non-MSAA texture?
- How to get shader version from QOpenGLShader?
- "Capture GPU Frame" in XCode -- iOS only?
- Difference between glewGetString(GLEW_VERSION) and glewIsSupported
- Tesselation result flickering - OpenGL/GLSL
- Water rendering in opengl
- Texture mapping consuming physical memory
- Rotating a Cube using Quaternions in PyOpenGL
- Switching from perspective orthographic projection in OpenGL
- FreeType2 and OpenGL : Use unicode
- Should Meshes with and without Skeleton use different Shaders?
- How to get accurate 3D depth from 2D screen mouse click for large scale object in OpenGL?
- Trying to load 2d texture with glTexImage2D, but just getting blank
Related Questions in LIBGDX
- Creating a random item generator in java,to use in a libgdx project
- Installing Google play service to Libgdx game
- Admob slows down my game - LIBGDX
- Popup with scrollable area
- Removing sprite when Touched
- How do you generate specific random number?
- How to render things expressed in seconds
- Comparison error for isometric sorting
- Does the game engine allow me to intergarte native android code
- LibGDX - load and process texture asynchronously
- Calculation position of a Vector between two others
- Libgdx: Objects creating other objects
- Drawing individual pixels LibGDX
- How to remove Sprite/Object from ArrayList?
- how to get control-c to kill only the running process and not sbt itself?
Related Questions in VECTOR-GRAPHICS
- Custom C++ Quaternion Rotation Not Working Correctly
- Vector drawables that are automatically converted to pngs
- Cross-Platform Vector Format
- Matching two vector paths
- How to find angle of rotation to make an SVG arc "stand up" with css3d
- Exporting Bezier curves from R?
- Cannot load vector Drawable in bitmap in XML
- Using vector graphics with JavaFX
- Vectr graphics program
- EPS file from R loads very slow in evince
- Should I use MySQL Geo-Spatial data types for vector graphics
- Tracing an outline using Qt Graphics
- How to reuse vector images in wpf properly
- Depth sorting triangles in static vector 3D engine
- Identifiying the next point on the surface of a cube
Related Questions in RASTER-GRAPHICS
- DirectX11 pixel shader in pipeline is missing
- Can I use ROPs in Canvas? (I care for performance reasons only)
- General algorithm for rastering vector image
- how to overlay a raster image on leaflet, on demand?
- How and when does viewport change happen in OpenGL? (glViewport)
- What image synthesis techniques does the term "rendering" apply to?
- Optimizing render of content in Html5 canvas
- Antialiasing alternatives
- Merging rasters
- Producing a raster plot in R
- How do I fit a vector curve outline envelope to an offscreen bitmap?
- PCL: printing out partial page without ejecting
- Convert CAD to raster
- Rasterize 3D line
- Dip when joining blended antialiased lines
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Generally, yes, the
SpriteBatchAPI is more optimized than theShapeRendererAPI in Libgdx.ShapeRendereris designed for debug overlays and for being easy to use. But, it depends on the specifics of how you use the APIs, too.The
ShapeRendererAPI assumes your viewport is mapped to pixel units. It determines the number of vertices to use in the circle based on a rough guess. You may be creating too many vertices for each circle (and you may be able to improve the performance without sacrificing fidelity by reducing the number of vertices computed).For any specific case though, it makes sense to profile your code and see where the time is actually being spent before optimizing.