Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Strange tiling/seams in Simple Noise node

Discussion in 'Shaders' started by KaleidoVII, Jul 14, 2019.

  1. KaleidoVII

    KaleidoVII

    Joined:
    Dec 20, 2016
    Posts:
    2
    I'm working with Shader Graph in Unity 2019.1.0f2. The Simple Noise node that I am using shows strange artifacts in the texture that propagate all the way through to runtime. See below. What could be causing this? Do I need to be sampling with UVs in a particular way? Thank you!

    upload_2019-7-14_11-18-33.png

    upload_2019-7-14_11-20-33.png
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    6,970
    What OS and hardware are you using? Specifically what GPU? And what platform is your project set to?

    I don't necessarily have a solution, but the answer is you shouldn't need to do anything special. Unity is using a common sine based psuedo random value generator for the noise functions. That noise function has two major flaws. One is it's not a very good random value generator in the best case, and the other is it produces different values on different GPUs, sometimes very different to the point of being completely broken.

    Here's an example:
    https://www.shadertoy.com/view/4djSRW

    When the page first loads, both sides should look roughly the same. After about a 30 seconds the right side will start looking obviously worse, and continue to get worse looking. That right side is using roughly the same noise function as Unity.
    89D7C201-A77D-4E94-A7CA-790DE5E95F2D.jpeg

    A0827704-4910-480A-BC9D-8E13C46C3368.jpeg

    But on some GPUs the right side will start out looking less like noise and more a blocky mess. I'm going to guess that's what you see. The left side should look the same on almost all GPUs.
     
  3. KaleidoVII

    KaleidoVII

    Joined:
    Dec 20, 2016
    Posts:
    2
    I think you're totally right! Mine looks like this after a few seconds:

    upload_2019-7-14_13-53-41.png

    System Info:

    OS: Windows 10
    Model: Dell Inspiron 7373
    CPU: Intel i5-8250U 1.6 GHz
    RAM: 8GB
    GPU: Intel UHD Graphics 620
    Building for Windows.

    I assume that the issue is that I'm using a laptop with integrated graphics. So this will perform fine on other hardware, you think? I'm just working away from my GTX 1080 desktop so I suppose this wouldn't be an issue if I build on that.
     

    Attached Files:

  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    6,970
    Yep, Intel integrated graphics and most mobile GPUs have a hard time with that noise function.