question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BRDF LUT uses the sRGB format, by design?

See original GitHub issue

The textures seem to be loaded using the following formats:

textures/brdfLUT.png  ->sRGB
models/DamagedHelmet/glTF/Default_emissive.jpg  ->sRGB
models/DamagedHelmet/glTF/Default_normal.jpg  ->RGBA
models/DamagedHelmet/glTF/Default_AO.jpg  ->RGBA
models/DamagedHelmet/glTF/Default_albedo.jpg  ->sRGB
models/DamagedHelmet/glTF/Default_metalRoughness.jpg  ->RGBA

the BRDF lookup table seems to be using the sRGB color space. Is this by design?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
snagycommented, Apr 24, 2018

@emackey In your case where you’re computing it in a shader and putting it into a texture, you shouldn’t be converting from sRGB unless you’re calculating the values in sRGB space or converting before you store them in a texture (you might have reason to do this if you want to take advantage of sRGB’s adjusted precision). Glancing at your code, I don’t think you’re doing either of those.

IIRC, the BRDF LUT from IBLBaker is in sRGB. I don’t remember how I determined this, so I could definitely be wrong here.

1reaction
emackeycommented, Apr 24, 2018

I’ve been wondering this too. @snagy Would you be willing to comment? In particular:

https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/0d1a32003253067ab98e6aaca9e8028028a4ef65/shaders/pbr-frag.glsl#L150

Is this conversion simply because the PNG behind this is stored in sRGB?

In Cesium I have a branch open where I’ve applied the Linear/sRGB conversions. But I didn’t apply this conversion on the BRDF LUT, because in Cesium it is computed in a shader. I think this makes my dev branch have much more “rim lighting” than master, and of course adding the conversion puts it back the way it was. I’m trying to figure out if the conversion is supposed to be there, even for textures that have been computed as opposed to read in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BRDF LUT uses the sRGB format, by design? #64 - GitHub
BRDF calculated online (before the actual PBR renderpasses) and loaded from the LUT texture yield same result only if sRGB to linear transform ......
Read more >
Physically Based Rendering in Filament - Google
The values are given in sRGB and must be used as the base color in our material model. ... BRDF fails to capture...
Read more >
Moving Frostbite to Physically Based Rendering 3.0
BRDF fm. For the specular term, fm is a perfect mirror and thus is modeled ... a renderer which uses spectral values instead...
Read more >
Color Profiles - PataBlog - Patapom.com
Standard profiles like ProPhoto RGB, Adobe RGB and sRGB that each have their use depending on your goal (professional photography, web design, video...
Read more >
Proper Texturing Workflow for Unreal Engine - Video Games
No changes to materials, and using @bleleux's ACES LUT? ... For export since we're still using sRGB in Unreal, we would export the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found