Tag Info

New answers tagged

1

Your hunch is correct. There must be external information mapping regions of the image to sprites. Even in your regular grid-based example, you lack some information like origin, collision extents, named identifier.


1

using a single vec4 uniform you can use arbitrary sized sprites: uniform vec4 spriteLoc;//x and y is the relative offset and z and w is the scaling factor varrying vec2 texCoord;//0-1 as you would without the atlas main(){ gl_fragColor = sampler2D(atlas, texCoord.xy*spriteLoc.zw + spriteLoc.xy); }


0

For first picture: We are creating projection matrix. For example, the parameters used are: Left1, Right1, Bottom1, Top1, Near1, Far1. Here, Aspect_Ratio_1A = (Right1 - Left1) / (Top1 - Bottom1); Then we are doing a view port transformation. For example, the parameters used are: Width1, Height1. (I am not mentioning shift parameters for simplicity). Here, ...


3

In my experience with android, it is the garbage collection the kills the performance, not the allocation, although these two are tied hand and hand. As mentioned on the comments, pre-allocation is a way to deal with this issue. This is known as a memory pools. Another similar solution is object pool pattern. An object pool allocates as needed, but does ...


1

you problem is with the following call: glDrawArrays(GL_TRIANGLES, 0, pObj->Meshes[x]->vertices.size()); you need to pass in the amount of vertices you are drawing aka pObj->Meshes[x]->vertices.size() / 3


0

I got this working. Adding these two lines in my rendering function DrawFrame() : glEnableVertexAttribArray(gvPositionHandle); glVertexAttribPointer(gvPositionHandle, 3, GL_FLOAT, GL_FALSE, 0, 0); solved it.


0

There are two possibilities, as far as I know: Draw your geometry using one of the GL_LINE* topologies: GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES. Use a fragment shader and some math to define the wireframe on-the-fly, without changing the topology. See this very nice example using WebGL: Wireframe display with barycentric coordinates.


2

A (triangular) face is created using tree or more vertices. An aiModel contains a list of all vertices in the model and a list of faces. Each aiFace contains the indices to vertices that make up this (triangle) face. An index is the position in the list of vertices where the vertex we want is. Here is some pseudo code that retrieves the thee vertices of the ...


1

Programming in GLESSL is a bit different than programming for a normal CPU. Since you're using OpenGLES 2, I will assume you are using GLESSL 1.0. So I will be pulling quotes from its documentation. In general, GLESSL offers you a variety of types as programming aids, with some guarantees regarding their behavior, but leaves the actual low level ...


0

Yes, it is absolutely possible. Fill rate is not such a problem because mobile graphics chips are designed to deal with very high resolution screens. In fact, deferred rendering helps with this because your lighting calculation is independent from scene complexity, so overdraw doesn't cause a slowdown. Here is my implementation on a fourth generation ...



Top 50 recent answers are included