Home Unreal Engine

Weird white artefacts after baking lights

polycounter lvl 7
Offline / Send Message
underfox polycounter lvl 7
Hi everyone, I need some help with my scene, I have thos weird white artefacts after baking my lights and i don't know how to get rid of it. I searched on google and found that it was due to DX11, but i couldn't find an answer on how to solve this problem.

djci.jpg

As you can see they seems to appear where the textures is pitch black. Any help would be greatly appreciated.

Replies

  • Santewi
    It's because the DX11 renderer turns negative pixel colors into that. You can just make a postprocess material that clamps the min value to 0 and add it to your PPChain.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    Santewi wrote: »
    It's because the DX11 renderer turns negative pixel colors into that. You can just make a postprocess material that clamps the min value to 0 and add it to your PPChain.

    or fix it in the material, why would the material be giving out negative values?
  • Santewi
    passerby wrote: »
    or fix it in the material, why would the material be giving out negative values?

    True, but if you have like 500+ materials (not material instances) it could take a while. Of course it would be better to do it that way, but clamping the values in a postprocess is a quick and dirty way of fixing it.


    By the way, I've found that these artifacts happen mostly when using NormalmapUncompressed.
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    I think white like that is typically more like the NaN (not a number. Like divide by zero) value rather than negatives. Negative color values in UDK are less predictable, but typically not that glaring white. Santewi's idea might work, and or check your shader to see if there's some math (likely division) in there that can result in undefined values.
  • mAlkAv!An
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    This issue is indeed related to normalmap compression modes (uncompressed, bc5). The reason is that the blue channel is completely black with DX11 ((it's white with DX9) which seems to mess up mipmaps and introduces errors when deriving NormalZ.
    The only workaround I've found so far is to mask the red+green channel in the material and then append a scalar for the blue channel. Interestingly enough this does decrease the instruction count, shader compiler is obviously cutting off DeriveNormalZ.
  • Santewi
    The blue channel is not black, it just may have negative values.

    Clamping the normalmap to min (-1, -1, 0) max (1, 1, 1) usually fixes it, although if you are getting negative values for the Z your normalmap might not be normalized.
  • mAlkAv!An
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    It is if you use TC_NormalmapUncompressed or TC_NormalmapBC5 in DX11 mode. Both of these compression types only store R/G channels for better quality and automatically calculate NormalZ in the material.

    Clamping values in the material does remove white pixels but not artifacts in general.
  • Santewi
    I know what they do. I was just pointing out that the Z value is not completely black.

    Anyway, the NormalmapUncompressed format is extremely buggy and it's better not to use it in DX11.
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    Sorry for the time I took to reply and thank you all for the information provided, the post process solution did worked out, no more white artefact, yet since it is a dirty trick and i'm not too fond of dirty tricks I prefered to understand the problem and fix it inside the material.

    So I broke the links 1 by 1 until I noticed that the diffuse power was the cause of the white artefacts. I was using my original diffuse texture as a diffuse power and once removed from the diffuse power channel everything went back to normal.

    Still I don't fully understand why it does that , should the texture in the diffuse be made with shades of grey and then apply the diffuse color in the diffuse power or something like that?
  • Santewi
    Diffuse power is kinda like the smoothness of the transition between lit and not lit areas of the surface. The higher the power, the smoother the transition will be, but the surface is not "lit" as much if it's not directly not facing the light source.

    As far as I know, it's just (L.N)^DiffusePower.


    You don't need to use DiffusePower 99.9% of the time.
  • underfox
    Offline / Send Message
    underfox polycounter lvl 7
    Ah ok I see, I was using it wrongly then, since i was using it to boost the diffuse color. Everyday is a school day, thx a bunch everyone problem solved and more knowledge acquired thankx to all of you :P
Sign In or Register to comment.