Hi, my . My entities have translation, scale, localtoworld and rendermesh components, I populate the render mesh with this custom mesh:
public static Mesh GetTextureMesh(int Width, int Height)
{
Mesh mesh = new Mesh();
Vector3[] vertices = new Vector3[4]
{
new Vector3(0, 0, 0),
new Vector3(Width, 0, 0),
new Vector3(0, Height, 0),
new Vector3(Width, Height, 0)
};
mesh.vertices = vertices;
int[] triangles = new int[6]
{
0, 2, 1,
2, 3, 1
};
mesh.triangles = triangles;
Vector3[] normals = new Vector3[4]
{
-Vector3.forward,
-Vector3.forward,
-Vector3.forward,
-Vector3.forward
};
mesh.normals = normals;
Vector2[] uv = new Vector2[4]
{
new Vector2(0, 0),
new Vector2(1, 0),
new Vector2(0, 1),
new Vector2(1, 1)
};
mesh.uv = uv;
return mesh;
}
And I have material (basic one with Unlit/Transparent) that I load trough Resources.Load, assign texture to it and add it to the entity:
public static Material GetSpriteMaterial(string Material, string SpritePath)
{
Material material = new Material(Resources.Load<Material>("Materials/" + Material));
Texture2D texture = Resources.Load<Texture2D>("Sprites/" + SpritePath);
material.mainTexture = texture;
return material;
}
I update the rendermesh trough entities.foreach.withoutburst().run()
Trough entity debugger, my mesh and material are added to the entity, but they are not rendered.
I use URP and the newest version of everything.
And nothing.