HLSL Material streaky artifacts

Hello!

I’ve been learning some HLSL and how to write it in Unreal but I’ve been running into an interesting situation with my materials.

The material displays some streaky artifacts during the animation and I can’t figure out where it’s coming from.

It seems like it’s not an issue with the Material node(from what I can tell) because it also happens when I preview the output of my custom HLSL before plugging it into the base color.
Does anyone have an idea of why this would be happening? This is a fresh 5.2 project.

Here are some screenshots and the code

float result = 0;
float pi = 3.14159;

for (int i = 0; i < nInstances; i++) {
  float angle = (i / nInstances) * time * pi;
  float2 pos = center + radius * float2(cos(angle), sin(angle));
  result += length(pos - uv) < instanceSize;
}

return result;


UnrealEditor_oQB0AjaVxy

Hi Suzamaki,

Nice routine!

It’s because of a combination of using the “Emissive” node and your Antialiasing type - if you change that to MSAA or one of the non-temporal ones you should see a reduction in the ghosting.

Turning off AA did the trick.
That’s probably something I’ll want to dig into later but for now I’ll call it a win and move on :sweat_smile:

Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.