Table of Contents

🔳 CosterGraphics.Systems.OutlineSystem


🧑‍🎨🧑‍🎨🧑‍🎨Outline3DRenderFeatureAdv


Outline3DRenderFeatureAdv
🧑‍🎨🧑‍🎨🧑‍🎨
🎭 Mask Shaders:
⬜ Outline3DSimple-Msk-ColorTextureMask-Default.shadergraph
🧱 Outline3DSimple-Msk-ColorTextureMaskDepthTested-Default.shadergraph

⬛ Outline3DBasic-Msk-DepthTextureMask-Default.shadergraph
🟦 Outline3DBasic-Msk-NormalsTextureMask-Default.shadergraph
🟩 Outline3DBasic-Msk-UVTextureMask-Default.shadergraph

🪪 Outline3DAdv-Msk-ObjectIDTextureMask-Default.shadergraph

🖼️ Final Composite Shader:
🖼️ Outline3DSimple-Cmp-Silhouette-Outside-Default.shadergraph
(Or any other Simple tier Composite shader)

The Advanced Renderer Feature supports composite shaders that require one or more of the texture masks from the Basic or Simple renderer features and adds support for the Advanced mask textures listed below:

flowchart
    subgraph MaskTextures[🧑‍🎨🧑‍🎨🧑‍🎨Outline3DRenderFeatureAdv<br/>🎭Mask Textures]
    direction TB
        OutlineObjectIDTextureMask(
            <img src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineDepthMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineDepthTextureMask.jpg'/><br/>
            🪪Texture2D_OutlineObjectIDTextureMask
        )
    end

    style MaskTextures                 font-size: 12px, stroke-dasharray: 10 10, stroke-width: 2px;
    style OutlineObjectIDTextureMask   font-size: 10px;

    classDef default padding:20pc

  1. 🪪Texture2D_OutlineObjectIDTextureMask
    Color Texture mask containing the ObjectIDs from the Outline3D objects stored in the R channel, InstanceIDs which are assigned by the Advanced Render Feature stored in the (G) channel and a 1.0 or 0.0 boolean flag value if an ObjectID was written into the (B) channel.

The default Render Pass execution order of the 🧑‍🎨🧑‍🎨🧑‍🎨Outline3DRenderFeatureAdv is shown in the diagram below. After the mask Render Passes are done, the Outline3DRenderFeature executes the final full-screen composite pass, which renders the final outlines to the scene cameras:

flowchart
direction LR
%%{init:{'flowchart':{'nodeSpacing': 16, 'rankSpacing': 32}}}%%
    subgraph Outline3DRenderFeatureAdvRenderPasses["Render Pass Execution Order"]
    direction TB
        Outline3DRenderFeatureAdv(
            Outline3DRenderFeatureAdv
            <p align = 'right'>🧑‍🎨🧑‍🎨🧑‍🎨</p>
        )

        OutlineColorMaskPass(
            ⬜<b>OutlineColorMaskPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineColorMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineColorTextureMask.jpg' 
            />
            <div align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DSimple-Msk-ColorTextureMask-Default.shadergraph</i><br/>
            <b>Produces</b> :
            ⬜Texture2D_OutlineColorTextureMask
            </div>
        )

        OutlineColorMaskDepthTestedPass(
            🧱<b>OutlineColorMaskDepthTestedPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineColorMaskDepthTestedPass/CosterGraphics-Systems-OutlineSystem-OutlineColorTextureMaskDepthTested.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DSimple-Msk-ColorTextureMaskDepthTested-Default.shadergraph</i><br/>
            <b>Produces</b>:
            Texture2D_OutlineColorTextureMaskDepthTested
            </p>
        )

        OutlineCameraColorCopyPass(
            <b>📸OutlineCameraColorCopyPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/CameraColorCopyPass/CosterGraphics-Systems-OutlineSystem-CameraOpaqueTexture.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>None</i>
            <b>Produces</b>:
            Texture2D_CameraOpaqueTexture
        )

        OutlineDepthMaskPass(
            <b>⬛OutlineDepthMaskPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineDepthMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineDepthTextureMask.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DBasic-Msk-DepthTextureMask-Default.shadergraph</i><br/>
            <b>Produces</b>:
            Texture2D_OutlineDepthTextureMask
            )

        OutlineNormalsMaskPass(
            <b>🟦OutlineNormalsMaskPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineNormalsMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineNormalsTextureMask.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DBasic-Msk-NormalsTextureMask-Default.shadergraph</i><br/>
            <b>Produces</b>:
            Texture2D_OutlineNormalsTextureMask
        )

        OutlineUVMaskPass(
            <b>🟩OutlineUVMaskPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineUVMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineUVTextureMask.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DBasic-Msk-UVTextureMask-Default.shadergraph</i><br/>
            <b>Produces</b>:
            Texture2D_OutlineUVTextureMask
        )

        OutlineObjectIDMaskPass(
            <b>🪪OutlineObjectIDMaskPass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineObjectIDMaskPass/CosterGraphics-Systems-OutlineSystem-OutlineObjectIDTextureMask.jpg' 
            />
            <p align = 'left'>
            <b>Requires Shader</b>:
            <i>Outline3DAdv-Msk-ObjectIDTextureMask-Default.shadergraph</i><br/>
            <b>Produces</b>:
            Texture2D_OutlineUVTextureMask
        )

        OutlineCompositePass(
            <b>🖼️OutlineCompositePass</b>
            <img 
                src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineCompositePass/CosterGraphics-Systems-OutlineSystem-FullScreenCompositeSilhouetteObjectID2HSVColors.jpg' 
            />
            <p align = 'left'> 
            <b>Requires Shader</b>:
            <i>Outline3DAdv-Cmp-Silhouette-ObjectID2HSVColors-Outside.shadergraph</i>
            &lpar;Or any other Advanced or lower tier Composite shader&rpar;
            <b>Produces</b>: 
            The final composite image
        )
    end
    subgraph Output[Output]
    Out(
        <b>🎥Camera Color Buffer</b>
        <img 
            src='../../../../../images/articles/Systems/OutlineSystem/RenderPasses/OutlineCompositePass/CosterGraphics-Systems-OutlineSystem-FullScreenCompositeSilhouetteObjectID2HSVColorsFinal.jpg' 
        />
    )
    end

Outline3DRenderFeatureAdv --> OutlineColorMaskPass --> OutlineColorMaskDepthTestedPass --> OutlineCameraColorCopyPass --> OutlineDepthMaskPass --> OutlineNormalsMaskPass --> OutlineUVMaskPass --> OutlineObjectIDMaskPass --> OutlineCompositePass ===> Out

style Outline3DRenderFeatureAdvRenderPasses stroke-dasharray: 10 10, stroke-width: 2px;

style Outline3DRenderFeatureAdv         fill:#109999
style OutlineColorMaskPass              
style OutlineColorMaskDepthTestedPass        
style OutlineCameraColorCopyPass          
style OutlineCompositePass              fill:#501099
style Output                            stroke-dasharray: 10 10, stroke-width:2px;
style Out                               fill:#109999;

%% Adds a padding to the default node class to make all the nodes the same size
classDef default padding:20pc
%%classDef strokeDash stroke-dasharray: 5 5
%%classDef default padding:20pc, stroke-dasharray: 5 5
%%classDef wideNode padding:20pc