Q1: 是否支持自訂shader
A1: RayQuery 可直接整合進 compute, fragment 等 shader 使用,無需另外自訂 shader stage
Q2: 硬體查詢的性能資料能否提供
A2: 因實際性能受content 許多因素影響,建議嘗試 Mali Mobile Studio 2022.4 獲取實際數據
Q3: 如何標記可穿透的mesh(比如半透明的毛玻璃)
A3: 可透過 Ray Query 獲取 instance id 對應 material 參數來查該 mesh 是否為半透明;若需進一查 triangle 透明程度,可透過 barycentric coordinates 內插 uv 值後,進一步查詢 texture
參考資料: https://nvpro-samples.github.io/vk_mini_path_tracer/index.html#perfectlyspecularreflections/refactoringintersectioninformation (由 barycentric coordinates計算normal的案例)
Q4: 能否自訂RayPayload結構標記物體屬性?
A4: 因 Ray Query 可自行整合進 compute or fragment shader,RayPayload 可以儲存進 SSBO or output render target
Q5: 系統級別參數(SvstemValuelntrinsics)介面文檔?(ex WorldRavOriain. WorldRavDirection etc)
A5: 在 shader 中可使用 rayQueryGetIntersectionObjectRayOriginEXT, rayQueryGetIntersectionObjectToWorldEXT 等函式獲取類似訊息
https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_ray_query.txt
Q6: 天璣9200每秒大約可以支援多少次的光線求交
A6: 這視場景複雜度與ray spawn pattern會有很大的差異,但就 Vulkan Samples 的 Ray Query範例 (per pixel 1 shadow ray, 9 AO rays),透過 Mobile Studio 觀察 Mali Core Ray Tracing Properties大約 125M rays/s
Q7: 移動端不同bounce次數對應的性能資料
A7: 這跟 image resolution, 場景幾何複雜度、material 複雜度有高度相關。目前即便 PC 也無法負擔全屏 RT multi-bounce 效果,故建議 mobile 應用僅針對重點處計算 multi-bounce 效果較好。
Q8: 在構建tlas過程中進行的更激進的剔除機制,其中除了PVS外有哪些其它的cullina機制,過於激進的剔除如何避免漏光
A8: 漏光跟 AS內模型面數複雜度是品質跟性能間的取捨,UE 是根據 distance and/or solid angle 剔除物件,動機希望多保留對近景渲染有效用的物件。