psydack / uimgui

UImGui (Unity ImGui) is an UPM package for the immediate mode GUI library using ImGui.NET. This project is based on RG.ImGui project.
MIT License
344 stars 53 forks source link

use packageRequirement in shader files #25

Closed ahmidou closed 2 years ago

ahmidou commented 2 years ago

compiling using the builtin pipeline gives errors because of the subshaders for universal and HD render pipeline. you can add PackageRequirements that way in PassesUniversal.hlsl and DearImGui-Procedural.shader to overcome the issue

    // shader for HD render pipeline
    SubShader
    {
        Tags { "RenderType" = "Transparent" "RenderPipeline" = "HDRenderPipeline" "PreviewType" = "Plane" }
        LOD 100

        Lighting Off
        Cull Off ZWrite On ZTest Always
        Blend SrcAlpha OneMinusSrcAlpha

        Pass
        {
            PackageRequirements {
                "com.unity.render-pipelines.high-definition"
            }
            Name "DEARIMGUI HDRP"

            HLSLPROGRAM
            #pragma vertex ImGuiPassVertex
            #pragma fragment ImGuiPassFrag
            #include "./PassesHD.hlsl"
            ENDHLSL
        }
    }
psydack commented 2 years ago

Awesome. That's a must and requested feature. Thank you