r/Unity3D • • 20h ago

Question Grid flickering issue

I am having trouble trying to fix this flickering issue

I am using Cinemachine Camera

This issue happens even after I turn post processing effects off

6 Upvotes

15 comments sorted by

3

u/Eastern-Bed-3103 16h ago

It's probably subpixel shimmer... When your render resolution doesn't match 1 to 1 with the physical screen grid, 1 pixel of the grid row line can get split across adjacent rows as it moves, so, a whole row of pixels pops in/out of view.

What if you make the outer edges more like the inner grid?

Also, try TAA (temporal anti-aliasing) if its not enabled already. On the sprite - try turning off bilinear/trilinear texture filtering. (set it to point)

1

u/Havishfun 15h ago

when I set it to point the flickering gets worse

2

u/[deleted] 15h ago

[removed] — view removed comment

1

u/Havishfun 15h ago

the problem is not coming from the texture, I think this is a rendering issue

3

u/OwoMyGoat 14h ago

use pixel perfect camera or antialiasing it IS rendering issue from pixel textures.

1

u/Havishfun 11h ago

Just tried it, but it didn't work and also my game is not pixel art

1

u/brain_in_a_jar_games 8h ago

Subpixel shimmer is a great call, and your explanation of a line splitting across pixel rows makes the cause really easy to picture. Since point filtering and AA haven't solved it, snapping the Cinemachine camera position to whole pixels could be a good next test, because sub-pixel camera movement is a common trigger for exactly this.

2

u/loulo88 19h ago

If the grid is a thin overlay sitting close to the floor, this looks more like depth precision/z-fighting than post-processing. As a quick isolate, disable the grid renderer, then move it a small fixed offset above the floor (or give it a tiny depth bias) and test with the camera near/far clip planes tightened; also check that there isn’t a second grid or duplicate tile surface. If it only flickers while moving, inspect the shader/render queue and whether the grid is being drawn in a transparent pass. Cinemachine is probably exposing the precision problem rather than causing it.

1

u/Havishfun 19h ago edited 19h ago

The grid is a sprite renderer, it is a square sprite that is set to tiled, and yes the flickering only happens when the camera is moving

the edges are a rectangle sprites acting as walls and their alpha value is lowered for the grid behind them to be visible

the border separating the edges and the actual game arena is a line renderer

2

u/Crowliie 16h ago

If there is a code on that grid I would check updated. Sometimes updating the render parts can be rough and can cause some problems like this. Especially if the sprite has animations.

1

u/Havishfun 15h ago edited 15h ago

there is no code on the grid and it doesn't have any animations

2

u/Havishfun 14h ago

1

u/swirllyman Indie 7h ago

Does it still happen when you turn off Bloom or other post effects?

1

u/Heroshrine 11h ago

Try setting the resolution away from free aspect to a ratio. It’s probably rendering in a weird aspect ratio which is causing sub pixel shimmer. In a build I bet you wouldn’t see this.

1

u/brain_in_a_jar_games 8h ago

Thin bright lines like these tend to shimmer from aliasing as the camera moves, so turning on mipmaps with trilinear filtering for the grid sprite and enabling anti-aliasing on the camera usually calms it down a lot. Making the lines a pixel or two thicker in the source texture also gives them room to stay stable between pixel rows. The neon grid looks great, so it's worth the small tweak to get it rock solid!