Skip to content
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

"Force Blinn over GGX" option not useful anymore #22637

Closed
tagcup opened this issue Oct 2, 2018 · 7 comments · Fixed by #51716
Closed

"Force Blinn over GGX" option not useful anymore #22637

tagcup opened this issue Oct 2, 2018 · 7 comments · Fixed by #51716

Comments

@tagcup
Copy link
Contributor

tagcup commented Oct 2, 2018

The optimized GGX merged in #22483 is faster than Blinn (which uses exp2 and pow), so this option should be removed, or at least should be disabled by default in GLES2.

An alternative and useful option would be to force low-quality approximation for GGX over the usual one.

@tagcup
Copy link
Contributor Author

tagcup commented Oct 2, 2018

@reduz Similar optimization (from Filament docs) for the anisotropic case was also adapted in that same PR so it's now too slow now. Maybe anisotropy can be enabled in GLES2 now (assuming there aren't any other limitations)?

@tagcup
Copy link
Contributor Author

tagcup commented Oct 2, 2018

Actually, Burley+GGX can probably be made faster than Blinn+Lambert, such that "Force Lambert over Burley" option can also be removed.

The expensive part of Burley is the calculation of H (and cLdotH), which involves division for normalization, but these are actually already calculated in both GGX and Blinn. If we simply reuse those values (which are calculated in the same function block), the cost of Burley becomes 14 multiplications, 3 additions, 2 subtractions whereas Lambert is 1 division, 1 multiplication, 3 additions, 1 max() call. Given how slow division tends to be, forcing Lambert over Burley probably won't be worth it.

@tagcup
Copy link
Contributor Author

tagcup commented Oct 2, 2018

I went ahead and refactored the calculation of H, L.H and N.H #22639 to avoid double calculations

@fire
Copy link
Member

fire commented Nov 28, 2018

This has been completed correct?

@tagcup
Copy link
Contributor Author

tagcup commented Nov 30, 2018

Yes

@fire
Copy link
Member

fire commented Nov 30, 2018

Solved by #22639.

@fire fire closed this as completed Nov 30, 2018
@tagcup
Copy link
Contributor Author

tagcup commented Nov 30, 2018

Ah, no, it's not solved. What I mean is everything required for obsoleting forced Blinn+Lambert is done.

This issue is about actually making them obsolete (or removing them altogether) which hasn't been done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants