Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [draw-order]

For questions pertaining to the order in which sprites, tiles or other graphics are rendered.

0
votes
0answers
15 views

How to draw lines or draw lines between objects through touch?

I'm working in unity and in one of the activities I have to generate different vertex and the player would have to be able to squeeze an object and move the finger to another object, if someone can ...
1
vote
0answers
45 views

Incorrect draw order with LineRenderer

I have a Player game object with a sprite renderer and a line renderer. The sprite for its body and the line for a rope. The problem is that the rope isn't visible (I can see it's drawn in the scene ...
-1
votes
1answer
114 views

Depth sorting issue

I've been working on a custom tile-based map editor for a while now, and everything works as expected, or so I thought until I've tried rendering the actual map including the dynamic objects as well. ...
1
vote
1answer
330 views

How to drag 2D objects and stop it if collides with other 2D object?

This is the code I am using but it's not working. It drags other object on collision: ...
7
votes
2answers
3k views

OpenGL - How come drawing sprites takes so much performance

I'm wondering how drawing simple geometry with textures can eat up so much performance (below 60fps)? Even my good graphics card (GTX 960) can "only" draw up to 1000 sprites smoothly. The textures I'm ...
0
votes
1answer
94 views

Different z index within the same tile

When you are looking at this image: the player is standing behind the tree. I know that can be accomplished by drawing the background first the player second and the upper tree part after that. The ...
1
vote
0answers
42 views

XNA Further faces are shown through closer faces

I'm trying to draw a 'axis' model named 'XYZ'. The problem is that it is rendered wrong (screenshot below). You can see that the blue face can be seen through the red face. The black, green and red ...
1
vote
1answer
443 views

SFML position problem when drawing a CircleShape

I am not sure but I think it's a problem with Windows 10 borderless windows The problem is when I draw the circle its always drawn with a little offset from where it should be. In the top of the ...
0
votes
1answer
513 views

How to draw a character behind and in front of a building? (isometric map)

how is it possible to draw the player behind and in front of some building in an isometric map : should I slice them, replace the number in the map (one number for a tile usually) by an array of ...
0
votes
1answer
635 views

Line renderer in 3D sorting order

I'm using a line renderer as a laser aim for my character. If the aim hits an object it ends at that object. If the aim doesn't hit an object it continues a predefined distance. If I aim at an object ...
0
votes
1answer
5k views

LineRenderer sorting order - lines always in front of everything

I have 3 cameras and 3 canvases. Back Camera: depth = -5, Back Canvas: Sorting layer - BackLayer, Camera: depth = 0, Middle Canvas: Sorting layer - MiddleLayer, Camera: depth = 10, Front Canvas: ...
1
vote
1answer
287 views

Creating Multiple Render System to Draw Different Entities in Entity-Component-System

When creating ECS based game engine, do you (or can I) create multiple rendering systems? Let's say I have an Entity class which is the basic unit in my engine, all it can do is add, remove and get ...
0
votes
1answer
440 views

Top down tile based game render order

I'm making a simple top down (like this) tile based game (using JavaScript, for reference) I use Tiled for making maps. I have sprites that are more than one tile high, and so whenever they are in ...
0
votes
1answer
1k views

Particle systems and sprites, draw order issue

I have a particle system, and my character, which is a sprite. I want to create a particle for smoke/dust raising from the ground, and I want my character to be able to move over it. The problem is ...
1
vote
1answer
209 views

Isometric painter's algorithm problem

Note: I dont use tiles, I use 3D Polygons :) I'm currently working on a real-time renderer for scanned real life objects. My main goal is to have an isometric viewer with the simple ability to rotate ...
1
vote
0answers
366 views

2D Voxel isometric rendering with non grid-aligned objects

I'm currently working on making a simple SDL2 game (written in C++) where the maps are comprised of sprite voxels (essentially just a png of an isometric cube). Game entities move in 3D space. The ...
1
vote
0answers
54 views

Why it takes some time to update the sprite draw order in libgdx SortedIteratingSystem?

I have a rendering system that extends SortedIteratingSystem and created a comparator to sort the sprite draw order. But the problem is when I update the z index, it takes some time before it changes ...
1
vote
2answers
1k views

How to handle Tilled Map z index order with player in libgdx?

The below 1st image is the example how I render tiled map with player, I can properly change the player z index, If I want to make the player below the box i just set the z index to 0. But the problem ...
0
votes
0answers
223 views

A few questions about Order Independent Transparency

I've been looking through several different Order Independent Transparency algorithms. But very few of them seem to answer a few things. I understand that the idea of OIT is to not worry so much ...
1
vote
0answers
104 views

Having problems drawing entities the right way in my isometric game

I am making an isometric game where I have moving Entities's not bound to tiles, and a 3d ArrayList map which is populated by <...
1
vote
2answers
2k views

How to make a Sprite be displayed always behind everything else?

What I am in need to achieve is to have a Sprite always facing the camera identically to what happens with any simple game UI object, but instead of always displayed above everything else, it should ...
5
votes
2answers
564 views

Drawing circles at the background of a 3D scene and updating their size

So, here is what I am trying to do in Unity 5 (using C#). I want to draw a a 2D circle at the background of a 3D scene and apply a texture/image to fill it. Just like it would be if the circle was in ...
2
votes
0answers
127 views

What is an efficient mobile rendering order supporting transparent and opaque objects?

I'm interested to know how others would do / have done this. Part 1. Constraints. My current renderer is being built to support OpenGL ES 2.0 primarily and so aims for performant mobile as well as ...
1
vote
1answer
372 views

Drawing order of 2D tiles with 3D bounding volume

I'm wondering which algorithm was used to draw the sprites of the video game Commandos in the correct order. Each sprite has a 3D bounding volume (either a polygon or a cylinder), this is how the ...
6
votes
2answers
5k views

How do I determine the draw order of isometric 2D objects occupying multiple tiles?

My current sorting method works only for objects that occupy 1 tile and fails for multi-tile objects. For examle, the bed in the above picture occupies 1×2 tiles, and the sorting fails. Also that bed ...
1
vote
2answers
709 views

How can I draw sprites in layers based on their Y position?

I am trying to figure out the most efficient way to draw sprites in a way that they layer properly based on their Y position. Lets say I have four objects of the same class named A, B, C, and D, and ...
5
votes
1answer
538 views

Multiple SpriteSheets break batching

The problem: I can't fit all my 2d animation sprites for all units and environment in 1 spritesheet. Everything batches fine until I use two spritesheets... I noticed the following : all units from ...
2
votes
0answers
871 views

How do I do 2D z-index parallax in Unity3d? [closed]

I am new to unity3d and want to develop a simple game like crazy cabie. I have to implement a z-index parallax for moving sprites towards the player and generating new sprite at the farthest z-index. ...
4
votes
2answers
5k views

Sprite draw-order in libgdx

From other frameworks I know methods for easy ordering sprites within a spritebatch (to determine if a sprite has to be drawn in front or behind another sprite). For example in MonoGame/XNA this is ...
1
vote
1answer
1k views

How do I use tiles and sprites together in an isometric scene?

I'm trying to write a 2D isometric scene. Rendering order is complex, since both tilemaps and sprites are different concepts. Rendering one of the 2 before the other will draw the scene incorrectly. ...
2
votes
1answer
1k views

Given face normal and vertices of a triangle, how to find the acyclic order of vertices?

I'm in the process of constructing a custom 3D triangle mesh. I found the vertices of the triangle in the 3D space and it's face normal. How do I find the acyclic order of vertices? If I draw the ...
0
votes
2answers
2k views

DirectX11: Drawing multiple objects

How can I draw many different objects on screen at once, with multiple vertex buffers, using DrawIndexed()? (Drawing the same object is simple, and I'm not looking ...
1
vote
2answers
464 views

How do I draw a sprite on top of a video in Andengine?

I'm playing a video in Andengine on @Override protected void onSetContentView() {} However, when I place a sprite on the screen at some point in time, it is ...
1
vote
3answers
1k views

Rendering order

In this thread Rendering a model with transparent or translucent uv map applied doesn't work , I asked about what was wrong with my model that the transparency wasn't working. I've got an answer ...
0
votes
1answer
623 views

Tile Maps and vertexZ order for sprites

Here is the setup. I have a orthogonal tile map made with Tiled. There are 5 layers. The bottom 4 comprise the background, while the top layer is the foreground that I will refer to as the “tree” ...
8
votes
2answers
1k views

How do I handle game objects with two depths?

I want to be able to do what you see in the image, but with a single wall. The player should be able to walk on either side of the same object. That is, the same wall is below the hero when I go down ...
1
vote
1answer
855 views

Painter algorithm on transparant objects

Why do you have to use the painter's algorithm when drawing transparant objects ? Can't you just use a z-buffer, draw all non transparant/opaque objects, then draw all transparant/opaque objects last? ...
0
votes
1answer
683 views

How to update “dynamicVertexBuffer” correctly with “setdata” on XNA?

I developed a small 3d games xna and uses a "DynamicVertexBuffer" and "DynamicIndexBuffer" to store and draw my vertices. Everything works fine, but my problem is the "Update" function where I update ...
6
votes
6answers
5k views

How do I efficiently sort objects by draw order when rendering a 2D game?

I need to render a "tile" game with objects that overlap, because they are taller than the tile they stand on, like the games in these screenshots: I don't know how to render them in the correct ...
1
vote
0answers
983 views

Best depth sorting method for a Top Down 2D game using a 3D physics engine

I've spent many days googling this and still have issues with my game engine I'd like to ask about, which I haven't seen addressed before. I think the problem is that my game is an unusual ...
0
votes
2answers
556 views

How many Fringe/Base layers in a 2D map editor?

I'm creating a highly flexible 2D tile-based map editor in XNA to make some of my future projects easier (will work for side-scrollers and top-down games). This editor can work with any sized tile. ...
12
votes
4answers
3k views

How do I determine the draw order in an isometric view flash game?

This is for a flash game, with isometric view. I need to know how to sort object so that there is no need for z-buffer checking when drawing. This might seem easy but there is another restriction, a ...
19
votes
9answers
16k views

How do I sort isometric sprites into the correct order?

In a normal top-down 2D game one could use the screen y axis to sort the images. In this example the trees are properly sorted but the isometric walls are not: Wall 2 is one pixel below wall 1 ...