4
votes
1answer
126 views

cost of texture change vs color change

How would I go about determining the difference in cost between changing the render color of an object every frame vice changing the texture (same sheet, just changing the source rectangle) every ...
0
votes
1answer
146 views

Create 2D sprites with libGdx using a shape and a texture separately

I am creating a 2D game with LibGdx that will have creatures that are generated from dozens of characteristics with potentially millions of unique combinations. For each segment of each creature, I ...
1
vote
2answers
140 views

What is the correct way to draw layered Sprites in modern OpenGL?

So what do I mean by layered sprites? Layered Sprites are Sprites that consist of multiple layers, e.g. you have sprite sheets for the basic Body, the Head, Clothes, Weapons, etc. Well now I wanted ...
1
vote
1answer
125 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
1
vote
1answer
208 views

How can I improve the performance of texture switching without resorting to atlasing?

I'd like to use texture images that are not a sprite sheet or other form of texture atlas, mainly because I'll be consistently adding and swapping textures while I figure out the direction my game ...
1
vote
1answer
169 views

Sprite rotation

I'm using OpenGL and people suggest using glRotate for sprite rotation, but I find that strange. My problem with it is that it rotates the whole matrix, which sort of screws up all my collision ...
0
votes
1answer
542 views

GLSL billboard move center of rotation

I have successfully set up a billboard shader that works, it can take in a quad and rotate it so it always points toward the screen. I am using this vertex-shader: void main(){ vec4 tmpPos = (MVP * ...
1
vote
0answers
370 views

Optimal OpenGL 2D Sprite Batching (Best Practice)

I am working on simple 2D engine using OpenGL (3.3+) for rendering and was wondering what the optimal method of sprite batching would be. I plan to put all sprites into one (or fewer) texture atlases. ...
0
votes
2answers
790 views

Drawing Sprites in Android OpenGL efficiently?

I want to basically give myself some sprite drawing functions (making use of openGL) such as; draw(Texture,x,y) I want to do this using OpenGL-ES 2.0 on Android. Since the textures can be varying ...
1
vote
0answers
190 views

Detect Sprites, they are in Shape or Not which random draw in Cocos2d

I have searched a lot on web and found some of help ful links as exact my question. Link 1 Link 2 But still i am not success to achieve this, i have done some of code lines, as like draw line by ...
0
votes
2answers
765 views

Multipule VBO in Opengl [closed]

I have currently in my application 2 VBO one which is a streamed buffer and for the moment the other is a static buffer. However even when the steam buffer is not bound and the static buffer is bound ...
4
votes
1answer
589 views

Batching dynamic sprites in OpenGL

I'm trying to wrap my head around how batching is done in a 2D sprite-based game. My understanding is I'd get the vertices that represent each sprite I want to draw and stuff them all into a single ...
4
votes
2answers
1k views

Sprite batching in OpenGL

I've got a JAVA based game with an OpenGL rendering front that is drawing a large amount of sprites every frame (during testing it peaked at 700). Now this game is completely unoptimized. There is no ...
1
vote
2answers
706 views

Animate sprite/texture position with VBO

I'm currently worlking on a renderer for my projects and I want animate a sprite on screen. I've got a spritesheet but I don't know what is the the best way to update the texture coordinates for each ...
2
votes
3answers
405 views

How can I create a spritesheet animation with big images?

If I have a 200x200 pixel sprite, and I want to create an animation for it with 30 different frames, how can I accomplish that? I can't put them on one texture/spritesheet.
0
votes
3answers
357 views

Dynamic Sprite Scaling in SDL?

I was wondering if I could get a player sprite effect similar to the one in this video using SDL (without openGL). If not, does anyone know how I might achieve that effect using SDL/OpenGL?
2
votes
1answer
1k views

Opengl drawing a section of a texture stretched over a quad

Current Situation I have a spritesheet loaded in for a texture when drawing the specific portions of the sheet that I'd like to have on my quads I do some simple math to get their location on the ...
2
votes
1answer
336 views

What is an OpenGL equivalent to ID3DXSprite?

As a Direct3D developer I can use the ID3DXSprite class (in D3DX library) for drawing 2D graphics. What's the best way to implement this functionality in OpenGL?
0
votes
2answers
3k views

How do I draw a point sprite using OpenGL ES on Android?

Edit: I'm using the GL enum, which is incorrect since it's not part of OpenGL ES (see my answer). I should have used GL10, GL11 or GL20 instead. Here's a few snippets of what I have so far... ...
8
votes
4answers
8k views

How to improve batching performance

I am developing a sprite based 2D game for mobile platform(s) and I'm using OpenGL (well, actually Irrlicht) to render graphics. First I implemented sprite rendering in a simple way: every game object ...
7
votes
2answers
1k views

How do I change a sprite's color?

In my rhythm game, I have a note object which can be of a different color depending on the note chart. I could use a sprite sheet with all the different color variations I use, but I would prefer to ...