Search Unity

Standard shader issue (white dots)

Discussion in 'General Graphics' started by Shushustorm, Dec 4, 2015.

  1. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Hello everyone!

    I’ve got a weird problem when using the standard shader that I have never seen before.
    One of my materials will show white dots on the object when I run the game on the actual device (iOS). In the editor, however, the shader looks fine and exactly like I want it to look.
    Also, the white dots are not located on one position. When I move in 3d space, they change. Probably according to glossiness?
    I attached some screenshots for reference.
    Does anyone know what could be the problem?

    Oh and keep in mind: While the dots may seem like a "somewhat minor" problem here, they are a big problem after all. As I said, they "animate", they "sparkle". So I couldn't even block the view over them or something like that as a workaround.

    Many thanks for any ideas,
    Greetings,
    Shu



    on mobile device
    screenshots mobile.PNG

    in the editor
    screenshots editor.PNG

    material component
    material component.PNG
     
  2. StevenGerrard

    StevenGerrard

    Joined:
    Jun 1, 2015
    Posts:
    97
    => First
    upload_2015-12-5_15-58-57.png <= this looks wired ... does your plane has the same depth value with your ground ?

    => Second, the problem you meet is very likely precision problem in shader ( fixed / half / float ) .
    => Consider you use standard shader, I think you need try modify the standard shader source to locate where is the problem.
    => How to locate problem ? Modify shader to "simple return albedo ( or normal, specular, uv... etc )" to check which component in shader bug.
     
    Shushustorm likes this.
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    It's coming from the specular. Pretty common when using the a PBR shader to get extremely hot points of specular, there's an entire series of rendering papers discussing ways to avoid this specular aliasing (see Toksvig, LEAN mapping, CLEAN mapping, normal map variance to gloss mapping, and more recently temporal super sampled anti-aliasing), though none of these options come with Unity by default. The real issue seems to be your normal map, it has some extreme changes in normal direction and you're getting single pixel hot spots from the bilinear transitions. If you remove your normal map it should go away. Otherwise looking at the small swatch of the normal map in the material I'm not entirely sure it's setup correctly to being with. It's rare to have large areas of a substantially different color like what you appear to have.
     
    Shushustorm likes this.
  4. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @StevenGerrard
    @bgolus
    Thank you for your replies!
    I tried modifying the albedo, but as I expected, that actually made the problem disappear. You see the blue object in my screenshots? This object has pretty much the same material on it except for its different albedo value (bright blue instead of brown) and that material works without this issue showing up. On the other hand, I need the brown color to be brown on some objects that use the material.
    So I took another look at my normal map and I chose "Create from Grayscale", which has been set to false before.
    After doing that, I will end up with a material that won't show any white dots, but its appearance changed quite a bit as you can see in the following screenshot (taken on iOS):

    screenshot.jpg

    Of course, now you can actually see the bumpiness of the normal map, but the wet looking glossy-effect is gone now. Maybe I have to add a metallic map now, too, so that I get the desired result without the white dots.