# Tag Info

1

Use polar coordinate system. Cast Moon's position to polar coordinates by formulas: r = sqrt( sqr(Moon_x - Earth_x) + sqr(Moon_y - Earth_y) ); phi = atan2( Moon_y - Earth_y, Moon_x - Earth_x ); Then, you can change angle (phi) to move Moon around the center: phi += angular_speed; And after that cast changed polar coordinates back to cartesian ...

7

You already know what you have to do, I'll just summarize it. There are three ways to solve your problem: Go ahead and make a conditional like you're saying, either by sampling the texture or by creating a separate uniform for this purpose. As you probably know, adding branching on a shader is almost never a good idea, and much less so in the fragment ...

1

What you want is a curvilinear perspective projection matrix to correct for the perspective projection distortion. aka barrel or pincushion projection: http://en.wikipedia.org/wiki/Curvilinear_perspective Basically, you distort the image with a projection that is the opposite of the distortion you don't want so it all comes out straight in the end. ...

0

You are most likely using compressed images on disk, when you try to access the data like images or audio files, the library is most likely decompressing them. One way to reduce memory is to use compressed texture formats. I don't know about libgdx but this is the way to go to reduce memory usage for textures. Regarding audio files, you can use lower ...

3

it's trivial, you can do it yourself. Assuming your sprites have alpha value 0 in unused areas, you can do the following (in pseudocode): pixels_out = pixels for y in pixels.height() for x in pixels.width() if pixels(x,y).alpha == 0, neighbour_in_sprite = false for y2 in [-1,0,1] for x2 in [-1,0,1] ...

6

You're not missing anything. The normal matrix exists in case the upper-left 3x3 of your regular model-view transformation is unsuitable for transforming normals (that is, contains non-uniform scale or other craziness). If you know the upper-left 3x3 is always suitable for use in the transformation of normals, there's no reason to bother with a separate ...

0

I suppose mobiles do not have dedicated Graphics cards (they have integrated GPUs) , so they utilize the RAM available on the device. To measure, you can try to allocate memory for textures until you run out of memory in order find an approximate limit on the VRAM available.

8

Your interviewer was talking, with his own words, about bindless API. nVidia made nice presentations recently about all that, which they call direct state access (1, 2). This does not replace VBOs. EDIT: Actually, let's consider Trevor Powell's suggestion: This seems like some people could definitely decide to drop VBOs, in favor of attribute-less ...

0

That is explained here by Shawn Hargreaves, the Xna lead coder http://blogs.msdn.com/b/shawnhar/archive/2010/04/05/spritebatch-and-custom-shaders-in-xna-game-studio-4-0.aspx

2

I don't think any of the other answers here will achieve the effect in Pokémon X/Y. I can't know exactly how it's done, but I figured out a way which seems like pretty much what they do in the game. In Pokémon X/Y, outlines are drawn both around the silhouette edges and on other non-silhouette edges (like where Raichu's ears meet his head in the following ...

Top 50 recent answers are included