Skip navigation
Some shadow map optimizations for Wicked Engine, now 16 viewports can be fully utilized for multiple…
0:00 / 0:32

Some shadow map optimizations for Wicked Engine, now 16 viewports can be fully utilized for multiple…

János Turánszki

@turanszkij11K followers

Visit on X
434 likesDownloadOriginal post

15,294 views

Some shadow map optimizations for Wicked Engine, now 16 viewports can be fully utilized for multiple lights' shadow draw calls with instancing. 256 dynamic pointlight shadows in Sponza:

9 Comments

Comments from the original post on X (Twitter)

  • János Turánszki's profile picture

    @turanszkij

    Now even multiple light types can be fitted into one draw: - directional: multiple cascades - point: up to 6 frustums - spot/rect: 1 frustum Previously the viewport instancing only happened for cascades and point lights, separately. Now all of them are batched.

    9 likes

  • János Turánszki's profile picture

    @turanszkij

    Viewports/cameras are created for visible light frustums while they can fit into the 16 available viewports (graphics API limit). Once 16 viewports are full, the scene is rendered once into all viewports. Instancing is used to select SV_ViewportArrayIndex by VS as before.

    10 likes

  • János Turánszki's profile picture

    @turanszkij

    About 5ms CPU time for shadow render in this scene (depends heavily on culling)

    4 likes

  • Dark Souls Lighting Engine's profile picture

    @DS2LightingMod

    Nice :) If I understand it , instead of geometry shader you are doing multiple instances and selecting the frustum for eg in Pointlights?

    2 likes

  • János Turánszki's profile picture

    @turanszkij

    Yes, the vertex shader gets the camera/viewport index from the instancing data.

    6 likes

  • Dark Souls Lighting Engine's profile picture

    @DS2LightingMod

    Thanks for the clarification. Love your work on wicked engine.

    2 likes

  • Лякуша Йцукен's profile picture

    @SudokuRandych

    *inspects closer* *gets dabbledazed by disco lights* Yeah that seems wicked enough.

    1 like

  • Sergei's profile picture

    @sergei_am

    Does the resolution of these frustums need to match?

  • János Turánszki's profile picture

    @turanszkij

    No, resolution is dynamic for each light, depends on its screen size.