17
votes
OpenGL - How come drawing sprites takes so much performance
Your GPU can probably render even 100k sprites without issues, but you need to do it smart. Sprites and other geometry must be supplied to a GPU in batches grouped by the same texture, shader and ...
3
votes
Accepted
Unity particles rendering on top of camera space UI
Increasing order in layer solved the problem.
2
votes
OpenGL - How come drawing sprites takes so much performance
The way you are batching your sprites might be suboptimal. If you're using glDrawElements() to render a batch of multiple sprites, then that can only mean you're ...
2
votes
Different z index within the same tile
As stated in the comments, that texture has a transparent background in the original game. That way they can just draw the base grass, then the player, then the tree.
2
votes
Accepted
How to make a Sprite be displayed always behind everything else?
You can do this with two cameras with different culling masks.
When you have multiple cameras in your scene, each camera will be rendered separately. The culling mask decides what will be rendered by ...
1
vote
What will happen if I intend to display the hidden surface after clearing the window, draw the game objects, and then display the window again?
From the documentation (emphasis mine):
This clear/draw/display cycle is the only good way to draw things.
Don't try other strategies, such as keeping pixels from the previous
frame, "erasing&...
1
vote
How to either draw a group of tiles completely behind or completely in front of a player?
This problem is usually worked out by collisions. Hopefully your tile editor allows you to set groups of tiles together along with their collisions, so you don't forget to set them. And that's it.
...
1
vote
Accepted
How can I render 3D objects and particle systems in front of a Screen Space - Overlay Camera?
To render 3D objects on top of your canvas:
Create a new Canvas in Screen Space - Overlay.
Add a RawImage to that canvas.
Create a new Render Texture.
Add the Render Texture to the Raw Image.
Create ...
1
vote
Accepted
Make non-sprite render in front of sprite
Okay, the solution was very rather simple. It was the sorting layer/order of the child of the projectile that caused it. Changing it solved the issue.
1
vote
Accepted
How do I order sprites by depth in Java, when their objects are of different classes?
I was thinking about putting them into an array list, and ordering them based upon their depth
YES.
but they are different object types. The guy is an object of class character, and the girl is an ...
1
vote
Accepted
How to drag 2D objects and stop it if collides with other 2D object?
I made a little sample project of how I would implement this, as a component you can simply attach to any gameobject you want to be made draggable.
I will include the code for the mono behaviour here ...
1
vote
Drawing circles at the background of a 3D scene and updating their size
Ok, so just of the top of my head your going to want to make a new circle(2d) and apply a texture to this then write something along these lines (and attach it to the object)
Pseudo code:
...
1
vote
Drawing order of 2D tiles with 3D bounding volume
You will have to sort the sprites based on their bounding box and start drawing things from back to front. In order to be successful with this you'll have to apply a mapping from the 3D coordinates (...
1
vote
SFML position problem when drawing a CircleShape
Do you have the same problem if you try to draw directly to the RenderWindow (window.draw(point, sf::BlendAlpha)), instead of drawing to a RenderTexture and then to ...
1
vote
How to draw a character behind and in front of a building? (isometric map)
I used a straight forward approach for this.
My map (not the end result!) is set up us horizontal lines, where i go from top to bottom, blitting everything from left to right. That way I ...
1
vote
Line renderer in 3D sorting order
UPDATE: doesn't work entierly!
I solved this by setting the camera's transparency sort mode to orthgraphic:
...
1
vote
Accepted
LineRenderer sorting order - lines always in front of everything
First of all - SpriteRenderer and LineRenderer don't cooperate, as they say on Unity forums.
...
1
vote
Creating Multiple Render System to Draw Different Entities in Entity-Component-System
What you should ask yourself is what is the actual difference between the two types?
An animated entity typically has both some form of a skeleton of bones which are animated through various ...
1
vote
Accepted
Top down tile based game render order
When you want to have overlapping sprites in your game, you need to put them in a list which you sort by the coordinate of the lower edge of each sprite and then render them in that order.
Further, ...
1
vote
Accepted
Particle systems and sprites, draw order issue
It is the case that all particles share the same Z order in unity. This is a weird design choice, but I believe it 's because the emitter is an object that is sorted with the rest of the world, and ...
1
vote
How to handle Tilled Map z index order with player in libgdx?
I see two solutions to this:
Make your player a part of the TiledMap by adding him to his own layer. This will automatically render him in the correct order like ...
1
vote
Accepted
How to handle Tilled Map z index order with player in libgdx?
Sort by z position. You will probably want to add an origin to every object as well to determine their position in the game world (ie the players feed, the center of where the box touches the ground, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
draw-order × 54rendering × 14
unity × 13
2d × 12
tilemap × 8
isometric × 8
tiles × 6
opengl × 5
3d × 5
c++ × 4
xna × 4
sprites × 4
libgdx × 3
particles × 3
spritebatch × 3
tiled × 3
c# × 2
java × 2
camera × 2
algorithm × 2
directx × 2
directx11 × 2
sfml × 2
depth-buffer × 2
index-buffer × 2