<p>I tried implementing my own diffuse irradiance map maker after reading <a href="https://learnopengl.com/PBR/IBL/Diffuse-irradiance" rel="nofollow noreferrer">Learn OpenGL &gt; PBR &gt; IBL &gt; Diffuse Irradiance</a>.</p>
<p>It takes an HDR image and makes six HDR cube map.
But It keeps making this very bright dots that altogether forms some kind of contour lines. (Almost looks like gamma correction artifact)</p>
<p>Any idea what possibly can cause this kind of artifacts?</p>
<p><a href="https://i.sstatic.net/HYnZs.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HYnZs.jpg" alt="enter image description here" /></a>
<a href="https://i.sstatic.net/H6dgE.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/H6dgE.jpg" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-10-26T05:34:26.663Z
Most likely you are undersampling, and the bright spots occur when one of your samples happens to land on the sun.
Nathan Reed
CC BY-SA 4.0
2021-10-26T07:08:08.043Z
@NathanReed You were right I was indeed undersampling. I’ll try more-sampling and see how it go.
Ingun전인건
CC BY-SA 4.0
2021-10-26T08:19:11.200Z
@NathanReed I tried more-sampling but the bright-dot problem persists. They just get little more blurry.
Ingun전인건
CC BY-SA 4.0
2021-10-26T08:20:42.907Z
I guess the samples that hits the sun are not properly weighted. I’m going to look into that part.
Ingun전인건
CC BY-SA 4.0
2021-10-26T15:32:18.017Z
Double check your sampling pattern and make sure you're getting well distributed samples as you increase the number? You could also try scaling down the input HDRI, so that you don't need so many samples when building the diffuse maps.
Nathan Reed
CC BY-SA 4.0
2022-01-31T07:26:04.200Z
I was following Learn OpenGL's PBR-Diffuse Irradiance chapter and turns out they were converting HDR into LDR before the sampling. I must have missed that step.
Ingun전인건
CC BY-SA 4.0
2022-01-31T07:27:36.447Z
But I still don't understand. Why would they use LDR environment in PBR rendering?
Ingun전인건
CC BY-SA 4.0
2022-01-31T16:48:19.543Z
That doesn't sound right. Can you point to where they're doing that in the article?
Nathan Reed
CC BY-SA 4.0
2022-02-01T01:42:47.353Z
@NathanReed Nevermind, I was wrong. They turn HDR into LDR only when they are rendering the skybox. 
Ingun전인건
CC BY-SA 4.0
2022-02-01T01:44:25.957Z
@NathanReed Also the same problem is addressed in the comment section and they say it's because the HDR image I'm using has abnormally high value by, for example, directly catching the sun, which is indeed my case.
Ingun전인건
CC BY-SA 4.0
2022-02-01T01:57:53.047Z
@NathanReed And I just realized you pointed out it in the first comment months ago. I could have solved it much earlier if I had listened!
Ingun전인건
<pbr><diffuse><ibl>
Contour-line looking artifact on diffuse irradiance map
Ingun전인건
# Contour-line looking artifact on diffuse irradiance map

(Asked by: username_0 on 2021-10-25)

I tried implementing my own diffuse irradiance map maker after reading [Learn OpenGL > PBR > IBL > Diffuse Irradiance](https://learnopengl.com/PBR/IBL/Diffuse-irradiance).

It takes an HDR image and makes six HDR cube map.
But It keeps making this very bright dots that altogether forms some kind of contour lines. (Almost looks like gamma correction artifact)

Any idea what possibly can cause this kind of artifacts?

[![enter image description here](https://i.sstatic.net/HYnZs.jpg)](https://i.sstatic.net/HYnZs.jpg)
[![enter image description here](https://i.sstatic.net/H6dgE.jpg)](https://i.sstatic.net/H6dgE.jpg)

**Tags:** pbr, diffuse, ibl

> **Comments:**
> **username_1**: Most likely you are undersampling, and the bright spots occur when one of your samples happens to land on the sun.  
> **username_0**: @username_1 You were right I was indeed undersampling. I’ll try more-sampling and see how it go.  
> **username_0**: @username_1 I tried more-sampling but the bright-dot problem persists. They just get little more blurry.  
> **username_0**: I guess the samples that hits the sun are not properly weighted. I’m going to look into that part.  
> **username_1**: Double check your sampling pattern and make sure you're getting well distributed samples as you increase the number? You could also try scaling down the input HDRI, so that you don't need so many samples when building the diffuse maps.  
> **username_0**: I was following Learn OpenGL's PBR-Diffuse Irradiance chapter and turns out they were converting HDR into LDR before the sampling. I must have missed that step.  
> **username_0**: But I still don't understand. Why would they use LDR environment in PBR rendering?  
> **username_1**: That doesn't sound right. Can you point to where they're doing that in the article?  
> **username_0**: @username_1 Nevermind, I was wrong. They turn HDR into LDR only when they are rendering the skybox.   
> **username_0**: @username_1 Also the same problem is addressed in the comment section and they say it's because the HDR image I'm using has abnormally high value by, for example, directly catching the sun, which is indeed my case.  
> **username_0**: @username_1 And I just realized you pointed out it in the first comment months ago. I could have solved it much earlier if I had listened!  

---

## 0 answers

