Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Bad HDR Lighting from HDR Map

Discussion in 'General Graphics' started by QuantumTheory, Dec 8, 2015.

  1. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    Hi,

    I can't seem to import a custom lat/long HDR map into Unity without it applying awful ambient lighting to my objects. The ambient lighting is completely inconsistent with other programs using the same HDR for image-based lighting.

    I get similar blown out light curve values with other HDRs. When I convert them to LDR, of course, they look as they should.

    What are the correct settings and use case for HDR and EXR files in unity 5.3? What am I missing?
     
  2. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    I am testing with a new project in 5.3... can you screen shot your texture import settings on that hdr?
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    I think something is iffy here...

    Can you try adding a light probe group that encloses that sphere? Does that make the lighting very flat?
     
  4. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    My test worked fine. If you zip your project, I can verify it.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    probesambient.jpg
    Something is wrong.

    Both look wrong to me. One is way too contrasty and the other is very flat. And they should look almost identical. The difference is one has lightprobes and the other doesn't (but it should be lit by the global ambient source, which is the skybox, which should result in the same lighting)
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    probesambient2.jpg
    (I over-exposed the cubemap because it exaggerates the problems)

    Light probes look too flat for me (I would expect the left side to be somewhat darker, like the static example looks).

    And Ambient just plainly looks wrong. At the very least, that one's a bug for sure.

    It's case : 751864
     
  7. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
  8. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Thanks for the file. I can reproduce your saturated banding effect just by opening it.
     
  9. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    The best results were to change RGBM encoding to off.
    But, this still leaves us with that dark spot on bottom. I tried my HDR (a sun-lit parking garage) and it doesn't have such a dark spot. By the looks of your EXR in an image viewer, I don't see why it would be black underneath.

    My next question is: do you have other EXRs that do this?
    I tried converting to HDR and, as expected, produced no dramatic change.
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    The exr I gave it does it as well.

    Also, yeah rgbm off improves it, but isn't that effectively turning hight dynamic range off?
     
  11. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Good question AcidArrow.. Docs are ambiguous. I wonder if turning encoding off leaves the data as is, which is true HDR.

    Can you post your HDR here, AcidArrow?

    I think this is a very important topic that requires clarity.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
  13. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    I have EXRs and HDRs. They all produce this bogus result.
     
    AcidArrow likes this.
  14. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    It doesn't do it with my HDR files. And, I have LOTS of them. Unless this is something you noticed with 5.3.. I just started using it today.
     
  15. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    probesambient3.jpg

    This one's just plain wrong.

    And light probes produce way too even lighting for the way this exr is set up.

    I don't think the files have anything to do with it. This is a bug. I filed a bug report, I think we should just wait for now.
     
  17. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    Thanks AcidArrow. Can you drop a link to the bug report (if one exists)?
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    I did tick "public" when reporting, but I don't see anything on the issue tracker. (maybe it takes a while for it to appear there? the latest issue I see there is from yesterday, and I find it hard to believe no one else posted a bug report today :) )

    I'll post here when I have any updates.
     
  19. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Thanks for submitting that, AcidArrow.

    QT: I just tried Arches_E_PineTree_3k.hdr from the link you sent. Looks fine. What does it look like for you? What I mean is: I don't see dark spots. This is just the ambient from the skybox on a Standard Specular shader. 2015_12_28_IBL_SampleA.png
     
  20. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    How does it look if you add light probes to the scene?

    (or if you over-expose the cubemap in the material?)
     
  21. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    AcidArrow: light probe shot attached below. Looks as expected.
    2015_12_28_IBL_SampleB.png

    Overexposure matched the environment as expected also. It did not behave like the other EXR file, which had a dark spot where it was not expected.
     
  22. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    Why does it look as expected? Isn't it supposed to capture the lighting of the environment? Which in an empty scene is practically the same thing that ambient does?

    Also in your first image, I am pretty sure the sky color (on the sphere) is wrong. It looks much darker and way too saturated.

    And the light probe image is way too evenly lit.

    In short, your examples exhibit the same issues.
     
  23. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    AcidArrow, are your observations something which occur only in 5.3?
     
  24. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    Why?

    (I believe so yes, but I don't explicitly remember testing this on other 5.x versions, so I could be wrong)
     
  25. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    I wonder if you think this is an old problem.

    QT: I assume this is a new problem, with regards to your original post? Or, have you had trouble with EXR files in earlier versions?
     
  26. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    I've never had luck with HDRs in Unity 5, but I've never dug deep into why it is until now. Their tonemappers haven't been good so I never really went far with it until 5.3 came along with their new one.
     
  27. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
     
  28. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    (slightly off topic, does anyone knows what exactly happens when you tick "public" in a bug report? I was expecting the issue to show up on the issue tracker, but it's still not there)
     
  29. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    AcidArrow, that is great news. Thanks. As long as they 'are on it'...

    Now, I wonder if this is a new issue or not..
     
  30. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    Considering the amount of people that reported on the forums that their ambient lighting started looking weird in 5.3, I'd say it's a new issue.
     
  31. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Great job, folks!
     
  32. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,298
    Thanks for the heads up, we are looking into this.
     
    theANMATOR2b and AcidArrow like this.
  33. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,298
    Hi, we found and fixed an issue in 5.3 where we multiplied by 2 in the wrong place. The fix is heading for a patch release asap but it is too soon to say which one. Now the probes and ambient is perfectly matching external reference tools.
     

    Attached Files:

  34. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    Very exciting. Thank you for such a complete response to the problem.
     
  35. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,082
    Guys this is still occuring in 5.3.1f1. I guess it hasn't been patched in?
     
  36. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,567
    I believe it was fixed in p1, not f1.
     
  37. brandoncstar81

    brandoncstar81

    Joined:
    Sep 15, 2016
    Posts:
    1
    We are using 5.3.6p4 and still experiencing this issue.

    We have been testing on iOS, android, and linux servers. our scenes use .hdr for ambient lighting, and they look decent on all the platforms, except iOS, the most important one in our case.

    The more colorful the skybox, the darker and more distorted our colors appear, as if being multiplied.

    Our short term fix is keeping the exposures low and saving the images out as .jpg, without exposure data, and using very low values of ambient lighting for the scene.

    when we do this, we lose a lot of the nice color influence that the skybox provided, and often have to add additional dynamic lights to boost the scene.

    Any help is much appreciated.
     

    Attached Files:

unityunity