Texture flickering and missing pixels

Started by
1 comment, last by treiguts 11 years, 2 months ago

Hi! smile.png

Youtube video with my "game":

">

I have missing pixel problem. At top left corner you can see few readings. My coordinates reading is missing some pixels from x coordinate (00:05 time in video). y coordinate is ok. That makes me believe, than my texture coordinates are calculated correctly. I'm not sure where should I start look for the root of problem. The same thing appears in FPS reading, P is missing pixels. But at the same time, CPU reading is ok.

Flickering - tiles/textures edge is flickering in white color. It is seen only when camera is moving. And again, I don't know where to look to fix it.

If my problems is uncommon, I supplied files as attachments. They are separated for each problem and redundant code removed.

Anyway, I hope for some suggestions smile.png

Advertisement

I think the area you need to be looking at is the mapping between the texels from your texture resources to the pixels of your frame buffer.

If you're trying to achieve a 1:1 mapping (aka pixel perfect rendering), then you might need to look to see if there's errors in your orthographic projection, or maybe play around with a sub-pixel offset when you render your quads. A common mistake is setting your window to, say, 1024x768 and setting up an ortho projection accordingly, but forgetting to account for the window border size - that would produce the kind of artifacts you're seeing.

If your images are intentionally scaled, then fixing the problem should be a simple case of enabling linear filtering on your texture sampler.

Indeed, adjusting proper window dimensions, fixed my missing pixel problem. Thanks C0lumbo. Flickering textures to be solved

Update:

Ahaa, I was able to solve flickering texture. Turns out, whenever I set camera coordinates according to character position, x and y coordinate were not rounded ( -10.5645;45.4545, for example ) and that resulted, I guess, in awkward camera placement or something. Anyway, coordinate rounding solved it. Thanks.

This topic is closed to new replies.

Advertisement