google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.44k stars 1.84k forks source link

Replace value of num_views with engine's eye count #7696

Closed z3moon closed 4 months ago

z3moon commented 4 months ago

For OpenGL multiview, it honors the qualifier layout(num_views = X) specified in shader files to determine the number of views for multiview.

We cannot recompile materials everytime the value changes. So replace the value of num_views with the engine's eye count when shaders compile.

z3moon commented 4 months ago

Why do this in materialparser as oppose to in the GL backend (like a spec constant replacement)? This will have impact the performance for even non-GL backends.

Actually I'm amending this PR as this is not the right place to modify as you mentioned. Let me update this as draft until it's ready.