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?
582 Views Asked by Hải Phong At
1
There are 1 best solutions below
Related Questions in OPENGL
- How to fix "Access violation executing location" when using GLFW and GLAD
- getting Access violation writing location when calling glDrawElements caused by shader
- Experimenting with GLFW library: window boundary problem and normalized coordinates
- OpenGL Framebuffer/FBO RTT subpixel movement discrepancy
- Why isn't my glfw window showing anything?
- How can glPushMatrix affect the rotation of an object around a rotating object?
- g++ / vscode apparently cannot see my src folder? "cc1plus.exe: fatal error: src/glad.c No such file or directory"
- Does addition-assignment cause dependency chain in GLSL?
- Compiling C++ program with Opengl and Glut in windows
- Using Silk.NET in WinForms
- What happens when rendering an OpenGL buffer that has been padded with NULL (or another value)?
- How can I make a sphere follow an eight-like path in Python using OpenGL?
- OpenGL only rendering second triangle, first triangle not visible
- OpenGL shows black texture on quad
- My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined
Related Questions in LIBGDX
- Lib GDX exported jar file does not detect assets
- LibGDX Normal Textures Not Showing Up in 3D (Blender) Model Java
- How do I resolve this rendering error with LibGDX and a Shadertoy GLSL Shader?
- Multiple TiledMap layers not rendering
- How to retain score when transitioning between Pause Scene to Game Scene?
- How to convert a text drawn using BitmapFont in LibGDX in an array of Sprites/TextureMapObjects?
- LibGDX Crashing when removing entity from its list
- How to change `Vector2` 's values in the virtual `render(delta:Float)` method of the Screen interface of com.badlogic.Gdx
- error build java project in vscodeThe project was not built due to "core does not exist". The project was not built due to "desktop does not exist"
- iOS app/game crashes with scene update failed message after launching using Libgdx and robovm
- Not able to catch errors in websocket onMessage
- Simple MMORPG - which protocol, technologies
- task superDev gives an error. Below is the result of stacktrace
- how can I fix this error? Libgdx and Gradle
- libGDX JSON File Reading Error: Unable to Load Skin Resources
Related Questions in VECTOR-GRAPHICS
- Replacing raster images in a PDF with vector images
- How do I generate automated parametric curve images on the command line faster?
- Generating random SVG arrow shapes
- Issues Automating White Removal from Color Images Trace with Custom Preset in Illustrator with Adobe Bridge or New Script
- Difficulties with understanding the SVG spec's description of the "vector-effect" attribute
- Is there an equivalent to the vector-effect property that can be applied to the SVG itself rather than each individual path?
- Extracting vector line segments from an image
- How to Export OSM Maps / Plots Into Vector Graphics Using Python Plotly
- Simplify any SVG path to create a solid black shape (UPDATED)
- Vector rotation of text in a given font and rendering it (in Python)
- SVG Clip Path Behavior under Translate Transforms
- Batch converstion from Png to SVG
- How to calculate if a triangle is back-facing or front facing in Vulkan
- What are the advantages of embedding SVG as an <img> element instead of as an <image> embedded in SVG?
- When to overload an operator in C++ as a member of a user-defined data structure and when not? I am completely lost
Related Questions in RASTER-GRAPHICS
- Replacing raster images in a PDF with vector images
- What image synthesis techniques does the term "rendering" apply to?
- Reverse Bresenham algorithm? How to convert array of drawn pixels into coordinates
- Rasterize plot when using PDF output device
- How and when does viewport change happen in OpenGL? (glViewport)
- Java, zoom operations for raster and vector data
- scale bar and north arrow in rasterVis plot in R
- Change names of stacked raster data in plot rasterVis package in R
- how to overlay a raster image on leaflet, on demand?
- How to interpret the pixel array in a 1 bpp BMP file
- Rasterize 3D line
- What algorithm can I use to distinguish between closed and open raster polygons?
- Contour of a run-length-coded digital shape
- main title in densityplot into grid.arrange raster stack data
- How would I convert a raster image to a usable format like jpg?
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.