filament icon indicating copy to clipboard operation
filament copied to clipboard

Add multiview_data for multiview information

Open z3moon opened this issue 11 months ago • 0 comments

Add a varying variable multiview_data for both surface and post-processing shaders. Currently this only works as intended in surface shader, and additional implementation to facilitate it for post-processing will be following.

The multiview_data contains multiview information like whether multiview is enabled for the current material and what the eye index is in that case. This variable is globally available including fragment shaders so that it can be referenced in user shaders in .material files. Also this allows us to directly use the constant variables such as gl_ViewID_OVR for OpenGL and gl_ViewIndex for Vulkan.

Make the preprocessor MATERIAL_FEATURE_LEVEL available for both surface and post-processing shaders, it used to be only available for surface shader, and this will be referenced in post-processing shaders later to support multiview for post-processing.

z3moon avatar Feb 04 '25 01:02 z3moon