-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Are brdfLUT sampling coordinates correct? #89
Comments
A (very) wild guess: This might be related to the infamous "y-flipping" of OpenGL, which has already been discussed here: #16 . Iff this guess is correct, then the coordinates are flipped (intentionally) because the implementation sets Side notes:
|
I think so too. If the Y-flip is wrong on this LUT, smooth areas will appear rough and vice versa. So if an implementation gets it wrong, the sample models will make that obvious (for example Damaged Helmet would not be shiny at all). Also, there are lingering questions about the correct colorspace of this LUT in #64. A new reference viewer is under development now, so this may change soon. |
Thanks for the input, looks like Y-flip is indeed the reason. I was questioning sRGB to linear space conversion myself as well. Usually it's only required for textures made by artists. I tried to go with or without colorspace conversion of this LUT and came to the conclusion that I like better the one with sRGB transformation (as it's in the code now). |
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. |
Hi!
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):
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:
The text was updated successfully, but these errors were encountered: