In my foliage I have a “wind sway” shader which uses “rotateaboutaxis” node to sway the foliage with the wind using world position offset. This works pretty well but after I add this to my shader, I get weird popping glitches of dark spots on the foliage. When I disconnect the wind sway nodes, the glitches are gone.
I’m on ue5, but i had the same problem on ue4 as well. any idea on how to solve this would be greatly appreciated!
here’s a video showing the glitch:
this is what my mesh looks like, no duplicate vertices:
Only thing I can thing of is that the object pivot is not in the correct spot.
Pat yourself on the back for asking help and providing near everything needed in order for us to try and help though.
Probably first post in this forum I have ever seen where this has occurred…
Other thing I can think of.
Set the LOD group to foliage.
and disable DFAO on it if it’s on.
instead of the max height mask. Vertex paint and use the mask to apply the wind.
Costs less. you get more control. and on the very off chance the calculations are at fault, you just eliminated the whole set of nodes…
(literally plug a single channel from vertex pain into the multiply).
-Just set the LOD group to foliage, no change
-I use DFAO for the whole project, do you mean disable it as a whole?
-You’re right about using vertex paint instead of height mask, I never considered that because I already use the vertex paint to paint the tips of the leaves for another “wind rustle” effect, but haven’t thought of using R and G channels!
Thank you for your answer!
That’s where I think it should be given the math - but is it actually there in engine?
And further, is it being considered by foliage or is it aggregating it?
Actor Position WS may be a better node. (depends on what the object pivot function is using).
No, just for the mesh.
You can set it not to generate distance fields, which will cause the DFAO shadows not to be created on it.
-I can’t figure out a way to disable DFAO for a single mesh? The checkbox is already checked off, and it’s off on every mesh because it’s checked on in project settings globally, and as it says here in the tooltip, it’s ignored if it’s enabled in the project settings.
Oh I forgot to mention, for some reason the glitching is happening rarely on instanced foliage objects, but it’s happening aggresively on regular static meshes. Same mesh, placed as a static mesh, glitching heavily.
By the way, are you sure about the Distance Fields checkbox thing? cause i have it enabled in the project settings and I’m using DFAO, but none of the hundreds of assets has the box checked. Am I not actually using DFAO lol?
100% sure? No…
I messed with the source code to get that going that way in .22 or something similar.
The other work-around is to set the custom distance field replacement mesh to something with a very small 3vert mesh.
I’m not sure why it’s being a pain.
Do this. click the background of the material to access the properties. Add a custom UV.
plug Actor Position into the UV.
use the CustomUV you added as the pivot point/replacement for actor location.
000 > transform position usually resolves to the position of the actor containing the meshes.
When foliage aggregates actors into groups this causes issues.
if you place a single mesh, this also means that the code you have should give you no artifacts at all.
In fact, since it probably doesn’t distort inside the material editor, you should expect that to be the same for the mesh if you place it in the scene.
So the next thing to try is to place a single mesh with the material at 0,0,0 to match the material panel rendering.
And the second thing is to move that mesh around to see if it generates the issue.
WHEN it generates the issue, it means that one of the calculations occurring on.with world position offset is wrong.