Tag Info

New answers tagged

0

One thing to think about here is that you are updating the entire mesh UV state for each tile you modify. I'd be sure to check and make sure it's not refreshing the mesh after each tile. you might return the UV updated array one level up and marge them all at once. Basically restructure so you calculate all, then apply the changes to the chunk/mesh. I also ...


0

Without knowing more about your code, its difficult to say why it would be running that slow. I can't imagine it taking 1-2 seconds to update 32000 UVs, that's not that large of a number, so my guess is that its doing something else horrible because of the fact that you are updating that many UVs. Either way, your solution will be similar. Since all the ...


2

Here are some answers to your questions: 1) If you want your sprite sheet to be compressed (which will reduce memory usage, at the cost of some quality), you will want it to be a power of two. If you are going to do completely uncompressed textures, then any size is OK. My recommendation is to stick with the power of 2, since that gives you the flexibility ...


2

It reorganizes the mesh data to achieve a better vertex cache hit rate by trying to group adjacent faces together in the buffer. The specifics of the algorithm are probably intentionally vague, so as to provide the possibility for the algorithm to have been updated or tweaked over time. I believe it is (or at one point was) based on the work presented in ...


2

Disclaimer: This is speculative. The DX specification doesn't define what it does, so it could be doing just about anything. That said The Wine implementation might provide some insight. That actual function implementation starts on line 7173, and I would like to note the text just below that: The face re-ordering does not use the vertex cache ...


2

A class is a chunk of code that can be reused as an object. An object is a single instance of something that can have certain properties (e.g. an integer representing a characters intelligence or money amount). Now that we have that settled... Going light on object creation and heavy on object reuse is generally better. It uses significantly less RAM to ...


0

Essentially what you want to do is compute the size of the object in pixels, then discard objects that are smaller than some threshold value. Use a bounding sphere rather than a box and the calculation becomes quite easy. Pre-compute a single radius value R for each object/mesh which is the maximal distance of any vertex from the origin in the object/mesh. ...


1

Not clearing the screen can actually degrade performance, because on double buffered framebuffer, a copy has to be performed when you swap buffers, which is apparently more expensive than simply clearing the current framebuffer to some default color value. (see http://stackoverflow.com/questions/2538662/how-does-glclear-improve-performance for example) The ...


0

I am also working on a tile based game right now for mobile devices. I am working with a canvas, and the way i solved this problem is to make a rect object of the canvas, and then chech if the tile intersects the rect of the canvas using the intersect() method.



Top 50 recent answers are included