Tag Info

Hot answers tagged

5

For one, nearest-neighbor will result in pixel perfect scaling only if it's used to upscale in integer multiples. Apart from that, you should not be conducting any scaling operations on your view/projection matrices. If you set your view to match the dimensions of the screen, and your projection matrix to be orthographic with dimensions that match the ...


2

You need to average the sprite pixels which are visible beneath each screen pixel. The sprite pixels can be sampled "nearest", but to move smoothly in subpixel increments on the display, you need some kind of oversampling. If you're using OpenGL, you can do this in your shader by averaging 4, or 9 or more sprite samples offset near each fragment (calculated ...


2

Using a lower number of bits per pixel means you save filesize, loading time and texture memory. Also, sprite drawing will be faster because less data needs to be moved between graphic memory sections. When you develop a 2d game and your target devices are desktop PCs, these factors can usually be ignored as any modern PC should handle 32bit graphics with ...


2

SFML 2.0+ makes it even easier to load a texture; sf::Texture texLid; std::string image2="images/top.jpg"; if (!texLid.loadFromFile(image2)) { std::cout << "Could not load" << image2; char c; std::cin>>c; return false; } glEnable(GL_TEXTURE_2D);//tell OpenGL to use textures when drawing ...


1

It is the the position and size within the Texture2D object. Set data can only alter the color data within the minimap. It can not alter the size or create new ones. The Nullable<Rectangle> rect is the destination within the Texture2D and the int startIndex, int elementCount is the source from the dataColors array. Here are a few examples. The ...


1

You'll want to look into pixel-art upscaling filtering algorithms (http://en.wikipedia.org/wiki/Image_scaling). These have been specifically designed to upscale pixel art, having the properties of (1) retaining the original color palette (aka. no blurring) and (2) removing jaggies (aliasing that occurs due to nearest neightbour sampling). Some names of ...


1

What are some best practices to determine the total texture budget of a modern 2d game? This likely depends on the size of your target platforms RAM/VRAM, and how much you'll need to have loaded at one time. It's probably something that you have to fine-tune. Another thing to consider is non-volatile storage (media/disk space, etc.). How can I tell ...


1

Try calling p.Apply() in your drawing code to set the effect correctly on the GPU before drawing. foreach (EffectPass p in drawingEngine.CurrentTechnique.Passes) { p.Apply(); // this will set the effect graphics.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, numVertices, 0, numIndices / 3); }


1

What values are you using for originX, originY, scaleX, scaleY? maybe you are using wrong values for originX and originY. The origin is bottom left corner of the textureregion as stated in the docs. To set the origin to the center of the texture set originX = currentFrame.getRegionWidth()/2; originY = currentFrame.getRegionHeight()/2; Hope this helps. ...


1

You could use compressed textures to store your 1bpp image, they can all store 1bpp images without loss as each tiles can have 2 colors (and in-betweens). PVRTC supports a 2bpp format, PVRTC is only supported on PowerVR devices. ETC1 and S3TC (DXT1) are 4bpp which comes back to the same size as 4x4 in RGBA4444 format but you don't need to combine and then ...



Only top voted, non community-wiki answers of a minimum length are eligible