How to make simple noise seamless with shader graph
Asked Answered
K

4

0

So I am making a game where there is a layer of clouds on top of a map. The clouds layer consists of plane tiles that have a cloud shader attached to them. The problem is that the shader material on the planes is not “repeating” or is not seamless as clouds are supposed to be. How could I make this so that there are no borders in the tiles? Or should I just use a repeating texture instead of simple noise?

206646-vtgp4lzo5q.png

I created the shader using this tutorial: https://www.youtube.com/watch?v=xxhvUyvIH6s

Knockwurst answered 9/1, 2024 at 10:28 Comment(0)
Y
0

I don’t have much experience using shader graph, but I think you need to offset the noise sampling. Notice how all the planes have identical noise maps. What you need to do is offset the sampling area by the scale of the sample, times the location of the plane.

Yiddish answered 23/4, 2023 at 17:20 Comment(0)
K
0

I could not find a straight answer but decided to use a seamless noise texture instead.

The textures I used: Seamless looping waves heightmaps | OpenGameArt.org
Credit: zookeeper

Knockwurst answered 28/1, 2024 at 20:49 Comment(0)
C
0

The easiest solution is probably to use the world space position instead of UVs. Assuming your game is in the xy-plane, you can simply connect a position node to the UV input of the tiling and offset node. This won’t result in seamless repetition but in seamless, non-repeating noise. Alternatively it is also possible to implement a gradient noise function with seamless tiling by using wrapped grid coordinates when calculating the random gradients but that’s much more complicated.

Cowbell answered 6/6, 2023 at 2:41 Comment(0)
I
0

I’ve found if you have more than one object with the noise, then you can use the “absolute position” as the UV cord for the noise, and the noise will tile between the objects:

image

Incident answered 28/1, 2024 at 20:49 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.