[question] Are brdfLUT sampling coordinates correct?
See original GitHub issueHi!
I was going through several PBR implementation and noticed that this implementation samples the BRDF LUT texture using the (1.0 - roughness) as a second texture coordinate:
https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/master/shaders/pbr-frag.glsl#L151
texture2D(u_brdfLUT, vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))
while all other implementations use just roughness (no “1.0 - roughness” flip):
- Google’s Filament: https://github.com/google/filament/blob/master/shaders/src/light_indirect.fs#L58
- LearnOpenGL: https://github.com/JoeyDeVries/LearnOpenGL/blob/master/src/6.pbr/2.2.2.ibl_specular_textured/2.2.2.pbr.fs#L162
- McNopper’s OpenGL: https://github.com/McNopper/OpenGL/blob/master/Example33/shader/brdf.frag.glsl#L46
- SaschaWillems’ Vulkan-glTF: https://github.com/SaschaWillems/Vulkan-glTF-PBR/blob/master/data/shaders/pbr.frag#L175
- SaschaWillems’ Vulkan: https://github.com/SaschaWillems/Vulkan/blob/master/data/shaders/pbribl/pbribl.frag#L136
LUT files across the different implementation look similar (see below). This fact makes me wonder who has it right? Our LUT: Filament’s LUT: LearnOpenGL’s LUT:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Specular IBL - LearnOpenGL
In the previous chapter we convoluted the environment map by generating sample vectors uniformly spread over the hemisphere Ω using spherical coordinates.
Read more >Metal texture sampling questions | Apple Developer Forums
In GL, I was sometimes making use of texture2DProj() to sample a texture using homogenous coordinates (vec3). There does not seem to be...
Read more >Texture sampling incorrect uv coordinate - Stack Overflow
I figured out the problem: normals/texture coords/etc must all share the same index as the vertex. I was arranging my texture coordinate ...
Read more >Texture Gathers and Coordinate Precision - Nathan Reed
A few years ago I came across an interesting problem. I was trying to implement some custom texture filtering logic in a pixel...
Read more >Solved Question #9: Texture sampling modes There are various
a) g1.Nearest mode will just take the pixel color of the single pixel that is closest to the texture coordinates it is currently...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As far as I understood, the reference viewer is about to be developed in this fork/branch: https://github.com/ux3d/glTF-WebGL-PBR/tree/reference-viewer , but it only just started. Correct me if I’m wrong.
Guess this one is sorted out. Thanks a lot for your inputs and closing it for now.