I’m trying to pass an extra float to my vertex shader because I need to divide my UV by some value I calculate in order to do projective correct texturing.
The batcher I am using is a modified version of the nez batcher. However after modifying the struct nothing renders, and no errors are thrown.
This is my struct after modifying.
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct VertexPositionColorTexture4 : IVertexType
{
//public const int realStride = 96;
// public const int realStride = 0;
public const int realStride = 112;
VertexDeclaration IVertexType.VertexDeclaration { get { throw new NotImplementedException(); } }
public Vector3 position0;
public Color color0;
public Vector2 textureCoordinate0;
public float q0;
public Vector3 position1;
public Color color1;
public Vector2 textureCoordinate1;
public float q1;
public Vector3 position2;
public Color color2;
public Vector2 textureCoordinate2;
public float q2;
public Vector3 position3;
public Color color3;
public Vector2 textureCoordinate3;
public float q3;
}
I don’t actually do anything currently with the extra value so I don’t think the issue is in the shader. Is there anywhere else I need to modify in order to do this?