Instancing with custom Stride DrawFX shader

Hello,

here is a simple shader for instancing :

shader Instancing_DrawFX : VS_PS_Base, Texturing, InstanceWorldBuffer  
{
    [Color]
    float4 Color = float4(1, 0, 0, 1);


    override stage void VSMain()
    {
        float4x4 w = InstanceWorld[streams.InstanceID].Matrix;
        w = mul(w, World);
        streams.ShadingPosition = mul(streams.Position, mul(w, ViewProjection));
    }

    override stage void PSMain() 
    {
        streams.ColorTarget = Color;
    }
};

And this the test patch for it :

I might be wrong but it seems that this line isn’t “working” :
float4x4 w = InstanceWorld[streams.InstanceID].Matrix;

Instancing.zip (6.9 KB)

Any hint ?

thanks

Alright just find out.

needed to set the hidden pin IsStructuredBuffer to true on the DynamicBuffer node.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.