Skip to content

How to combine the shadow map demo and the imGui demo? #560

@taesoobear

Description

@taesoobear

I tried combining the shadow map demo and the ImGui demo, but only either one of them works. For example, If I remove the shadow-related code, ImGui works correctly.
The way I combined them was fairly simple: I created a game state that holds two GameState instances simultaneously and simply forwards the relevant member calls to both. The ImguiGameState directly inherits GameState instead of TutorialGameState.

For setupCompositor, I tried a few approaches:

  1. Creating the shadow map workspace first, then adding the ImGui workspace afterward, as well as testing the reverse order.

  2. Creating a combined workspace, although I couldn’t figure out how that is supposed to work.
    CombinedWorkspace
    {
    connect_output StaticShadowMapsRenderingNode ImguiRenderingNode
    connect_output ImguiRenderingNode 0
    }
    In some cases, the application runs without errors, but either the demo UI or the shadows are not rendered. I also tried removing the debug overlay from the ShadowMapFromCode game state, but this only removed the debug text and still did not display the ImGui demo window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions