GL instanced shader problem.

@YTN

i’ve tested your sample:

    static InstanceData()
    {
        var elements = new VertexElement[]
            {
                new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 1),//0
                new VertexElement(12, VertexElementFormat.Single, VertexElementUsage.BlendWeight, 0)
            };
        VertexDeclaration = new VertexDeclaration(elements);
    } 

and

    float4 MainPSSimple(VSOutputSimple input) : COLOR0
    {
      //return input.Color * ParticleTexture.Sample(TexSampler, input.TexCoord);
      return input.Color * tex2D(TexSampler, input.TexCoord);
    }
1 Like