What can i do to stop the flickering in my material/texture? MSAA.

Im trying to understand what can i do about this.
When i move my camera, zoom in or zoom out. There is this weird flickering inside and around the texture.

Im using MSAA.
The video may not show it very well, but i uploaded also the project. It is 4.27.2:

TempFlickeringIssue.rar (5.2 MB)

Bumpity bump? BUMP :slightly_smiling_face:

Not going to look at the project itself (on mobile afterall), but this is fairly common in msaa with transparency and mips applied.

You can turn off mips if it’s just this one image - on all texture sampled for the shader. Particularly the transparency.

If the helmet is not a rendered flat image - which from mobile I can’t honestly tell, either: great work making the asset, or, “that’s a really bad idea with MSAA, convert it to a single texture flag”.

In essence the flickers should be occurring whenever the rendering is unsure if a particular shape falls on a full pixel or not. On edges.

So if the face is a 3d face, this will happen a lot. If the face is a flat image this should never occur.

If it is occurring on a flat face and no geometry or transparency is involved while mips are hard set, first thing to do is make sure you are on dx11. If you are, then not sure - maybe something getting computed at the shader level?

2 Likes

Yeah should have made a more clear video showing the material.
So the material is a combination of textures.
This is so that in the game you can load different Characters in the same Instanced Static Mesh, just need to change the index of the Texture 2D Array.

Though im speculating, because the problem can be anything. I noticed this happened in other projects its not the first time i deal with these flickering issue.
And cant understand where is the problem coming from.

In the video you can see i remove the MipMaps entirely, and the flickering still happens.

Is there anything i can show more to give a better clue where the problem might be?

i would have thought that mips would help with this issue. the video looks pretty normal to me anyways.

1 Like

yeah. no. the only thing that is helping so far is changing it to TAA.
Maybe its not very noticeable in the last videos.

But in this video i think you can tell the difference:

i have the hunch that you’re trying to do something that the engine can’t do.

if you want your image to be pixel sharp (in the filter) it will flicker when moving. as mosthost explained the engine needs to pick a pixel. when the texels are smaller than the pixels, you get flickers.

that’s where filtering comes into place, but that will make your picture look blurry on the distance.

now, i think i remember you asking for how to make your texture sharp before, so i assume you really want it to be using the “sharp” filter.

if the flickering occurs in “time” (e.g. the image is still, but yet it flickers) then it could be TAA.


after watching your previous video.

ok that kinda makes sense. taa works differently than msaa. msaa works on the geometry level not on texture (iirc i might be wrong), so it doesn’t affect your texture, and it shows the pretty normal moire pattern.

taa works differently. some people don’t like it.

i think you should check mips, maybe consider using filtering that’s not sharp. maybe have more mips. that’s some ideas. i’m not sure.

this is a video where you can see the issues with filtering and mips.

1 Like

I tried that. If you notice this is an issue that happens only when moving the camera. So any slight movement will cause the image to fry a little.

Though it seems there is no right solution for it, except using TAA.

which one did you tried? mips or filtering or both? (those are 3 different options).
though i don’t think it’s something you can completely get rid of

yeah that’s moire.

i personally would prefer to use filtering or mips instead of taa. as some people would want to disable it, and it has a great impact on many other aspects, so it could degrade the quality in other areas. though taa is not “wrong”, and i don’t know of a better solution sorry. so if it works for you go ahead. maybe someone else knows a better solution.

1 Like

So thats called noire. i didnt know that.

After a lot of trial and error in the settings you suggested it improved significantly.
The character is not having any noire now.
Only the green flag (thats another texture with lerp) around the edges.

Thanks. I think this is good enough for now.

1 Like

*moire actually. check out the video i’ve posted. it goes in great detail and really well explained. i think it could benefit you.

that’s how learning happens. well done!

Amazing that makes me happy to know! Great work keep it up!
It’s a great strategy to move forward by steps, and leave things for later if it’s not necessary to do immediately.

1 Like

Your hodge podge texture could partially be at fault here.

Wouldn’t it be more efficient to use something like a flip book to pick a whole face from a set of faces?

If that is part of the issue that’s left-over anyway.

I think it would affect stuff somewhat - because it is changed at runtime in the shader.

Fwisw - TAA is a horrible idea overall. Unless you like blurry messes, then it’s OK or even great :grinning_face:

You should run a quick test before anything.

Toss a pre-computed image in a shader, map it to a plane, put it on the side of the one you already have made, see if the effect persists.

2 Likes

You mean a flipbook instead of the Texture2DArray? Would it be different graphically?

The Texture2DArray allows as many characters as you want / need. I use it all the time.

>TAA is a horrible idea overall. Unless you like blurry messes, then it’s OK or even great :grinning_face:

Yeah im avoiding TAA because my game is mostly a sharp shapes 2Dish game. And it doesnt look good.

>Toss a pre-computed image in a shader, map it to a plane, put it on the side of the one you already have made, see if the effect persists.

Will try that. But the point of doing it all in the material is that it simplifies stuff as one HISM, so 1 draw call :flexed_biceps:

But i know this is not necessary. But i like to do this type of stuff sometimes.

side note: if you put all textures in a flipbook you might need to be careful with the borders and clamping modes.

i don’t really know much the diff between them. i’m not sure if a spritesheet would be bigger in vram than a texture2d.

1 Like