Questions tagged [pixel]

A physical point in an image or the smallest addressable element in a display device.

Filter by
Sorted by
Tagged with
21
votes
3answers
6k views

How does one avoid the “staircase effect” in pixel art motion?

I am rendering sprites at exact pixel coordinates to avoid the blurring effect caused by antialiasing (the sprites are pixel-art and would look awful if filtered). However, since the movement of the ...
20
votes
1answer
23k views

GLSL Light (Attenuation, Color and intensity) formula

I'm implementing point lights in my Voxel engine, and I'm really struggling to get a good flow of light, from 100% near the light source to 0% at the light radius. I have 5 arguments for the function:...
16
votes
1answer
19k views

Can Unity 2D be used to make pixel-art games?

I'm looking at the new 2D features introduced in Unity 4.3, and I think I might be missing something. To me it looks like they are designed for high-res 2D games, where scaling the sprites is ok, but ...
14
votes
3answers
5k views

How do I move the camera in full pixel intervals?

Basically I want to stop the camera from moving in subpixels, as I think this leads to sprites visibly changing their dimensions if just ever so slightly. (Is there a better term for that?) Note that ...
14
votes
3answers
9k views

How do I scale down pixel art?

There are plenty of algorithms to scale up pixel art. (I prefer hqx, personally.) But are there any notable algorithms to scale it down? My game is designed to run at a resolution of ...
13
votes
3answers
3k views

How can I replicate the color limitations of the NES with an HLSL pixel shader?

So since 256 color mode is depreciated and no longer supported under Direct3D mode, I got the idea to use a pixel shader instead to simulate the NES palette of all possible colors so that fading ...
12
votes
6answers
11k views

How do you move a sprite in sub-pixel increments?

Pixels are either on or off. The minimum amount you can move a sprite is a single pixel. So how you make the sprite move slower than 1 pixel per frame? The way I did it was to add the speed to a ...
11
votes
2answers
2k views

How do I perform an xBR or hqx filter in XNA?

I'd like to render my game scaled up with one of the hqx filters (hq2x, hq3x or hq4x) or an xBR filter in a shader. How can I do this in XNA 4.0 and SM3? Side note: this question has been heavily ...
9
votes
5answers
41k views

How do I scale up pixel art without blur in GM Studio?

I'm creating a game in Game Maker Studio that uses pixel art. When I launch the game, all scaled-up textures are really blurry. (It doesn't happen to small ones.) For example, this image renders ...
7
votes
2answers
7k views

Java single Array best choice for accessing pixels for manipulation?

I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered ...
5
votes
3answers
3k views

Optimum Screen Resolutions [closed]

Most PC games nowadays obviously come with the standard option to change the game's resolution from between 640x480 to 1920x1080 on average, depending on your monitor and whether or not you are ...
5
votes
2answers
1k views

In pixel art, should i keep the same color palette for every sprites?

The question may sounds weird (and very noobish but i'am :p) but i can't find any answer. When making pixel art, it is often said that a color palette could be 2, 4, 8, 16 or even 256 colors, through ...
5
votes
1answer
2k views

SDL render surface from byte array efficiently

In my current project I need to fill a 256x224 screen with the pixel values from an array. The array is declared this way: uint8_t *vram = new uint8_t[7168]; So as ...
5
votes
3answers
2k views

How do I efficiently manage the pixels, on the screen?

I've been looking for a way to efficiently manage the pixels on a screen, but so far all I've found is along the lines of SetPixel(), in Windows, and drawing a ...
5
votes
0answers
1k views

Slope handling in a tile-based platformer

I'm trying to implement slopes in my 2D tile-based platformer made in GameMaker Studio 1.4. I'm done with the normal solid block tiles, they work like charm, but slopes are even harder than I ...
4
votes
1answer
3k views

How to handle day and night in a 2D sprite game

Do I need to draw, for example, a tree how it looks in the day (normal colors) and how it looks at night (colors aligned according to the moonlight)? Or does Unity have a function for that?
4
votes
2answers
588 views

How to calculate area to fill in this Snake/Qix game variant?

I have a game which is a Snake/Qix variant. The player controls a line which is moving on an island. Player has possibility to leave the island in order to connect that island to itself. Once the ...
4
votes
1answer
384 views

Drawing different per-pixel data on the screen

I want to draw different per-pixel data on the screen, where each pixel has a specific value according to my needs. An example may be a random noise pattern where each pixel is randomly generated. I'...
4
votes
1answer
1k views

2D Software Lighting Issues in Java

I'm creating a 2D top-down tiled game in pure Java and by now I'm trying to implement a way to do lighting. First, some details on how I render: there is a screen class which handles all the ...
3
votes
2answers
4k views

Drawing a 1 pixel thick line in Unity

I'm trying to get a cross at the center of the screen (Two lines will do as well). I have a 2048x2048 Texture which I have thrown into a canvas. Filtering is set to point. The image is set to be in ...
3
votes
1answer
149 views

How could I do a 2d pixel design in game where you can see though the obstacles/upper floors?

Maybe the question didnt show much... but what I'm trying to do is e.g. if I'm in a train platform with two floors overlapped, or in a place where I'm blocked by some obstacle to see my char. from my ...
3
votes
2answers
2k views

Using pixel art on small high resolution screens

I'm making a game and I would like to utilize pixel art as my style. But I faced a problem, modern displays on my target platform (iOS) have extremely high resolution. So if my artist makes me some ...
3
votes
1answer
1k views

How does the Direct3D 9 rasterizer determine triangle coverage?

I'm working on a software rasterizer to use in my project. I have implemented one that works well, however, often my rasterizer under or overestimates triangle coverage. I need perfect emulation of ...
3
votes
1answer
1k views

Getting the rightmost point of gameobject

How do i determin the point on a gameobject that is most to the right (highest x value).
3
votes
1answer
5k views

How do I access the pixels of an SDL 2 texture?

How exactly can one get to the RGBA pixel arrays of SDL 2.0 textures? Does the texture need to be specially initialized and locked down?
3
votes
1answer
316 views

Making up everything from single pixels

I recently saw a game which looked a bit like minecraft, but it was a RPG. The enemies in this game consist completely of voxels and if they die, they collaps and every single voxels falls down, ...
3
votes
1answer
692 views

How do I multiply pixels on an SDL Surface?

Okay so I'm able to put blank pixels into a surface and also draw gradient pixels rectangles,etc But I don't know how to multiply the pixels on a surface so I was hoping someone could provide me ...
3
votes
1answer
907 views

Scaling sprite velocity / co-ordinates in Android

I'm trying to find the answer to a question that I've had for a long time, but am having trouble finding it! I hope someone can help :-) I'm trying to find information on how to scale sprite velocity ...
3
votes
1answer
2k views

Spritesheet per pixel collision XNA

So basically I'm using this: ...
2
votes
1answer
1k views

How to smooth the model/texture look from a distance?

(First of all, I really didn't know how to title my question so it tells exactly what I mean so if anyone has a better title feel free to edit my question or leave a comment.) Look at the water in ...
2
votes
2answers
485 views

Why is the pixel so popular as the metric unit of a game?

I keep seeing everywhere people using pixels for resolving collisions, angles, distances. I wonder if using the pixel as the metric unit for a game is a good solution, first because you're tying your ...
2
votes
1answer
2k views

How can I efficiently make a solid Texture2D?

I am trying to programmatically make an Image to cover the entire screen. I create the Texture2D, then create a Sprite from the ...
2
votes
1answer
2k views

SharpDX Texture to Image in C#

I currently have an image processing application that outputs processed images post pixel shaders have been applied. However, using the examples I've found on the internet, the colors are flip to BGRA ...
2
votes
1answer
256 views

How to alter image pixels of a wild life bird?

Hello so I was hoping someone knew how to move or change color and position actual image pixels and could explain and show the code to do so. I know how to write pixels on a surface or screen-surface ...
2
votes
1answer
94 views

How to render a grid of dots being exactly 1x1 pixel wide using a shader?

I would like to render a grid with many dots, all equally spaced and being exactly 1 pixel wide. What I was able to achieve so far is this : What I would like is (simulated using image editing ...
2
votes
1answer
290 views

Circular lighting mask stretches to ellipse in Monogame using Pixel Shader

I am trying to implement a very simple pixel shader for some basic lighting using this tutorial http://www.xnahub.com/simple-2d-lighting-system-in-c-and-monogame/ My problem is that when the effect ...
2
votes
1answer
4k views

In SDL2 what is the fastest / most efficient way to draw pixels onto the screen? Using SDL_RenderDrawPoint or SDL_RenderCopy with a Texture?

I want to add pixel splatters and particle effects to a game. For this my options were to have a bunch of pre-made animations in the form of textures, OR create a particle engine. For the particle ...
2
votes
2answers
756 views

Create a new Surface type with SDL_Texture

So I started using Awesomium, and I'm experiencing some difficulties. I want to create a new type of Awesomium::Surface and implement it in my custom ...
2
votes
1answer
114 views

Expandable player boundaries

I'm trying to plan how to implement non-fixed boundaries so the player can expand their controlled territory without using a tiled based system. Each pixel can be fought over for who controls it. I ...
2
votes
1answer
597 views

Java/Libgdx Pixel game with individual pixel changing

I am currently trying to make a game with pixelated graphics. The game is supposed to run with as few textures as possible. Instead of this it is supposed to generate the levels randomly, and fill in ...
2
votes
1answer
2k views

Is there a way to manipulate a pixel Array on the GPU?

I'm currently working on a 2D-Game and i want to draw and calculate the whole screen myself through a pixel array. I'm programming in C++, using SDL 2 and OpenGL specifically a OpenGL Texture which is ...
2
votes
2answers
246 views

How to do reflective collisions with particles hitting background tiles?

In my 2d pixel old-school platformer, I'm looking for methods for bouncing particles off of background tiles. Particles aren't affected by gravity and collisions are "reflective". By that I mean a ...
2
votes
0answers
101 views

Camera that follows a target with sub-pixel movement

As the title says, I have a character that moves at sub pixel movement (no, I can't change this, because this sub pixel movement happens when I normalize the vector during diagonal movements, ...
2
votes
0answers
308 views

How to make sure two Tiles not overlap each other?

I'm trying to make a Grid who will be easily convertible between 2D and 3D and I'm having a problem with overlapping prefabs in the case of the 3D generation. The thing is, the DataObjects (Tiles) ...
1
vote
2answers
3k views

How can I rotate a bitmap without D3D or OpenGL?

I've just figured out on my own how to scale a portion of a bitmap using PutPixel. I would like to know the mathematical theory behind rotating a bitmap on my own, ...
1
vote
1answer
7k views

How to get a pixel color from a specific sprite on touch (unity)?

I have a 2 layers of a different sprites. How can i get a pixel color from lower sprite? I know how to get touch and world coordinates, but i have no idea what to do next. ...
1
vote
1answer
5k views

How to use traditional pixel coordinates system in OpenGL? (with C++/SDL2)

I find the normalized, centralized coordinate system used in OpenGL weird and annoying, is there anything I can do at all to make it work like normal pixel coordinates on everything ever except OpenGL?...
1
vote
2answers
4k views

How big should my tiles be for tilemaps?

I'm creating my first tilemaps. Tutorials usually do 32x32px (example), but this tutorial did 128x128px, which made it easier for me to see without zooming in so much. In tiled, I did a 40 x 40 tile ...
1
vote
2answers
1k views

How to draw a rotated pixel perfect line by hand?

If you have a pixel perfect line like 1:16 pixels, and you want to draw that same line rotated by a degree, for example 45°, ...
1
vote
1answer
485 views

Fixed texture size (Pixel) libgdx, java

If I resize the window (e.g. fullscreen) the texture size also changes! I want that behaviour: If I change to fullscreen you will see more of the game world. The size (Pixel) of the texture stay the ...