Shader Graph wobble effect creates holes in mesh

Hello!

I’m rather new to Shader Graph. I was trying to make a wobble effect in shader graph for a slime enemy in my game. This is how the slime looks like without the effect:

Screenshot 2024-09-03 121141

I have my wobble effect as a subgraph that I then plug into the vertex position of my main slime shader. Here is the wobble graph:

The issue I’m having is that when the wobble effect moves the vertices, it creates holes in the mesh where the UV seams are. Here you can see:

And this is how the UVs are set:

Any idea on how can I get this wobble effect without creating holes in the mesh? Any help will be greatly appreciated.

Thanks!

It looks like your mesh is just three attached submeshes. GPU rendering works like that:
Left image = merged triangles and no holes (4 vertices, 2 triangles)
Right image = 2 split triangles (6 vertices, 2 triangles)
You must to combine common vertices (wild modifier in 3ds max or something similar)

Combining vertices might not help in this case, because as Kinopio42 said, the gaps appear along the edges of uv islands. In a 3D modeling program, you can usually combine vertices which belong to two different uv islands just fine, but on the GPU level, each vertex can only have one uv coordinate, which is why vertices around the edges of uv islands are always duplicated internally. See also the “Weld Vertices” setting in the model import settings: Unity - Manual: Model tab

Only vertices with “the same properties overall (including, UVs, Normals, Tangents, and VertexColor)” can be combined.

There was someone with a similar problem not long ago, maybe this will help you solve it: Why does vertex displacement create gaps between faces within the same mesh?

I think this will work:

In your Voronoi node, instead of using UV0 as the input, which is discontinuous across the surface of the slime, try to use something that is continuous, like world position.

At the UV seams, the shader computes each vertex twice, because there are 2 possible UV coordinates. And since there are 2 different UV coordinates, when the coordinate is mapped to the Voronoi node, you get different values for the same vertex but different UV.

What you want to achieve in the shader is to ensure that the Voronoi output is only dependant on the vertex position, and should be independent of UV and everything else.

1 Like

This did the trick! Thanks a lot!

1 Like