<blockquote>
<p>First we do gamma correction</p>
</blockquote>
<ol>
<li>Make sure you actually need to do gamma correction on the albedo texture (or rather &quot;uncorrection&quot;, i.e. making it linear). Not all textures are stored in sRGB color space. <s>Also, you're doing it the wrong way around: Going from sRGB to linear color space you need to do the <code>pow(1/2.2)</code> part here and the <code>pow(2.2)</code> part in the end.</s> (as @Owens pointed out in the comments, OP did it the correct way. See also <a href="https://learnopengl.com/Advanced-Lighting/Gamma-Correction" rel="nofollow noreferrer">LearnOpenGL sRGB textures</a>.)</li>
</ol>
<blockquote>
<p>Should I transform the luminance to radiance first before doing the tonemap or maybe I should convert it even before that when doing BRDF calculation?</p>
</blockquote>
<ol start="2">
<li>Yes you should convert before doing the BRDF calculation. Tonemapping is not a feature that's part of the actual physical simulation of light, therefore it doesn't &quot;need&quot; any physical units. The BRDF however is, and here you should make sure that your units &quot;add up&quot;. E.g. you wouldn't calculate the surface area of a rectangle by using meters as the unit for one side and inches as the unit for another side.</li>
</ol>
<blockquote>
<p>Do I need to convert the albedo with photometry curve after doing gamma correction?</p>
</blockquote>
<ol start="3">
<li>I'm not entirely sure here, but I think you don't need to do that. The albedo color basically tells you, how much of a certain light will be reflected. Since you change your light to photometric units (if you do it as suggested in the Frostbite notes), than I would say this already taken care of. You could also look at it like this: Since the color is a ratio and thus unit-less, there is no need to convert it from unit to another.</li>
</ol>

CC BY-SA 4.0
2019-04-05T10:00:31.987Z
Thanks for the correction for the gamma. About the answer number two. If I store light as color and luminous intensity. Then after I convert to radiometry unit, It is possible that the color will change right? Because each color contribute different amount of luminous intensity. Or should I just convert the intensity part by assuming efficiency is 100%?. I ask about tonemapping because I am not sure what unit should I deliver to the tonemapping operation. Radiance or luminance? Tonemapping will convert linear HDR to linear LDR. But not sure what unit is this linear HDR.
kevinyu
CC BY-SA 4.0
2019-04-05T12:14:49.243Z
The way I understand it, the color should not change, just your way of expressing the light. The same way that 2.54cm is the same as 1 inch. Thus, you have the same input for tonemapping, regardless of how you calculate your light.
Tare
CC BY-SA 4.0
2024-08-18T02:13:57.860Z
You have the gamma correction backwards.  The OP was correct, you do pow(albedo, 2.2) to get into linear space, and pow(albedo, 1/2.2) to get back to sRGB.
Owens
CC BY-SA 4.0
2024-08-27T07:13:08.127Z
Yes, you are right. I got it mixed up with undoing the display's gamma, which is called correction and is `pow(albedo, 1/2.2)`.
Tare
CC BY-SA 4.0
2019-04-05T09:45:14.540Z
2024-08-27T07:19:43.950Z
2024-08-27T07:19:43.950Z
Tare
<p>According to this <a href="https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf" rel="nofollow noreferrer">note</a>, Frostbite use photometry unit in their calculation. I am trying to mimic this feature, but I am not sure what transformation need to be done. I will try to explain what I have in mind.</p>

<p>First we do gamma correction(pow(2.2)) to the albedo texture. Then we apply the BRDF that takes luminance as input and will produce output luminance. After that we do tonemapping(say we use filmic tone mapping) and then inverse gamma correct pow(1/2.2) and store it to the framebuffer. </p>

<p>Is this process correct? Should I transform the luminance to radiance first before doing the tonemap or maybe I should convert it even before that when doing BRDF calculation? Do I need to convert the albedo with photometry curve after doing gamma correction?</p>

<pbr>
How to implement physically based unit in pbr renderer
kevinyu
# How to implement physically based unit in pbr renderer

(Asked by: username_0 on 2019-04-03)

According to this [note](https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf), Frostbite use photometry unit in their calculation. I am trying to mimic this feature, but I am not sure what transformation need to be done. I will try to explain what I have in mind.

First we do gamma correction(pow(2.2)) to the albedo texture. Then we apply the BRDF that takes luminance as input and will produce output luminance. After that we do tonemapping(say we use filmic tone mapping) and then inverse gamma correct pow(1/2.2) and store it to the framebuffer.

Is this process correct? Should I transform the luminance to radiance first before doing the tonemap or maybe I should convert it even before that when doing BRDF calculation? Do I need to convert the albedo with photometry curve after doing gamma correction?

**Tags:** pbr


---

## 1 answers

### Answer by username_1 on 2019-04-05. Score: 2

> First we do gamma correction

1. Make sure you actually need to do gamma correction on the albedo texture (or rather "uncorrection", i.e. making it linear). Not all textures are stored in sRGB color space. ~~Also, you're doing it the wrong way around: Going from sRGB to linear color space you need to do the `pow(1/2.2)` part here and the `pow(2.2)` part in the end.~~ (as @username_2 pointed out in the comments, OP did it the correct way. See also [LearnOpenGL sRGB textures](https://learnopengl.com/Advanced-Lighting/Gamma-Correction).)

> Should I transform the luminance to radiance first before doing the tonemap or maybe I should convert it even before that when doing BRDF calculation?

2. Yes you should convert before doing the BRDF calculation. Tonemapping is not a feature that's part of the actual physical simulation of light, therefore it doesn't "need" any physical units. The BRDF however is, and here you should make sure that your units "add up". E.g. you wouldn't calculate the surface area of a rectangle by using meters as the unit for one side and inches as the unit for another side.

> Do I need to convert the albedo with photometry curve after doing gamma correction?

3. I'm not entirely sure here, but I think you don't need to do that. The albedo color basically tells you, how much of a certain light will be reflected. Since you change your light to photometric units (if you do it as suggested in the Frostbite notes), than I would say this already taken care of. You could also look at it like this: Since the color is a ratio and thus unit-less, there is no need to convert it from unit to another.

> **Comments:**
> **username_0**: Thanks for the correction for the gamma. About the answer number two. If I store light as color and luminous intensity. Then after I convert to radiometry unit, It is possible that the color will change right? Because each color contribute different amount of luminous intensity. Or should I just convert the intensity part by assuming efficiency is 100%?. I ask about tonemapping because I am not sure what unit should I deliver to the tonemapping operation. Radiance or luminance? Tonemapping will convert linear HDR to linear LDR. But not sure what unit is this linear HDR.  
> **username_1**: The way I understand it, the color should not change, just your way of expressing the light. The same way that 2.54cm is the same as 1 inch. Thus, you have the same input for tonemapping, regardless of how you calculate your light.  
> **username_2**: You have the gamma correction backwards.  The OP was correct, you do pow(albedo, 2.2) to get into linear space, and pow(albedo, 1/2.2) to get back to sRGB.  
> **username_1**: Yes, you are right. I got it mixed up with undoing the display's gamma, which is called correction and is `pow(albedo, 1/2.2)`.  

---

