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