Why my meshes have some smoky after image

I am a newbie to Unreal engine. I have about 1 month of experience in actually handling UE5.

Some meshes I am rendering have some smoky after images.
Those meshes are moved by position offset feature in material shader graph.

I am following above video series to render grasses.
The above series uses material shader to change vertex locations, normals. Sine wave based function is used in material shader to control grass motion.
PCG is used to create each grass instance.

Above series control grass motion using sine wave based function that can be calculated by the material shader.
However, I wanted to create a more realistic motion that implements rotational dynamic.

It needs numerical method to calculate motion for each grass instance.
I need to store additional data per instance and need to update those instance data at each frame.

Each instance has angular velocity and angular displacement, and new angular velocity and angular displacement are calculated in each frame using the previous values.

So this couldn’t be done in material shader alone.

I needs to store additional data(angular velocity and angular displacement) for each instance.
I decided to store angular velocity and displacement as particle color and velocity in Niagara system, and these data are updated in Niagara’s particle update stage.

At the end I have made two versions of the grasses.

Niagara produced grasses with rotational dynamic.

PCG produced grasses with sine wave based motion(same as the first video series)

Also PCG produced grasses, but with more grass instance

And as you can see, the Niagara version creates a lot of disturbing smoky after images? or whatever those are.

The PCG version with less grasses also have some after images if you look carefully.

And the PCG version with more grasses, I can’t find the after images.

Do anyone know what is causing those smoky images and how to fix it?

I fitured out.
Changing the antialiasing method in project setting to something other than tsr solved the issue.

1 Like

“Ghosting” artifacts like these are caused by issues with motion vectors. Either the mesh is not outputting velocities at all, or they are wrong. There are project settings to control this if WPO generations motion vectors - but I think its usually on by default. Plus the fact that its worse in Niagara makes me think its specific to particle systems.

There is a setting in the mesh renderer called “Motion Vector Setting.” Try changing it to approximate or precise and see if that helps. You’ll see that with motion vectors disabled, the particle system has a smokey look. There was no visible difference between approximate and precise in my test, but there may be in your case.

Disabled:


Approximate:

Precise:

This should hopefully allow you to continue using anti-aliasing.

Thank you for your advise. So it is the difference between the particle velocity and the actual mesh velocity.

I am actually not moving the particles with velocity attribute.
The grasses just have angular velocity as a dynamic parameter vectors.
A grass base stays where it is spawned, it just has angular velocity that moves the two line segments that controls grass curve. The curve is actually a quadratic Bezier curve controlled by two line segments.

The angular velocity is applied to each vertex of the mesh via position offset in the material shader.

In my case, approximate and disabled setting give similar results.

If I do not set the particle velocity, both setting gives smoky effect and grasses further away from camera look like some viscous liquid.

If I approximate the average velocity working on each grass and set it to the particle velocity, the smoky effect on near grasses is reduced and further away grasses more look lie viscous liquid.

I approximated the average velocity working on a grass by multiplying its angular velocity to the length of one control line segment.

Auto detect and precise setting do not reduce the smoky effect even if I set the approximated average velocity.

Well I guess I cannot fix this without turning off TSR antialiasing for now.

Velocity is not just about the actual velocity of the particle, it is also about the velocity of a vertex. The latter is what matters for animated meshes such as grass.

Personally I would consider using the GPU compute of PCG to accomplish this. You’ll get the benefit of GPU acceleration that Niagara would provide, but you won’t have this issue.

I am trying to make dynamic system based motion with numerical method.
So I need to keep angular velocity and angular displacement of each grass instance.

Which is the reason I am using Niagara.

I really don’t want every grass particles to be updated whether they are visible in the camera or not.
I just want to update the motion of the visible grasses.
What I want to do is remove grasses when they are out of sight, and re-spawn the grasses when they are at the sight and update their motion while they are remaining in the sight.

This is off-topic of this post, but I am a newbie to Unreal Engine so I don’t fully know about PCG, so I’d like to ask.
Is there a feature in PCG that allow you to update per instance custom data of spawned meshes in each frame using some compute shader?

Thank you for leaving replies to my post so far by the way.

Yes, PCG has compute shaders, as well as hierarchical generation which allows for meshes to be generated based on both view direction and distance. PCG also supports per instance data, just like Niagara.

The video series you linked has some sections on per instance data, as well as hierarchical generation. That is actually my YouTube channel, and I also have a video that covers the basics of setting up a compute shader in PCG.

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