using Engine.Asset.Mesh;
using Engine.Graphics.Pipeline;
using Engine.Graphics.Texture;

namespace Engine.Scene.Component.BuiltIn.Renderer;

public class MeshRenderer : Component
{
  public Mesh Mesh { get; set; } = null!;
  public Texture? Albedo { get; set; } = null;
  public RenderLayer RenderLayer { get; set; } = RenderLayer.DEFAULT;

  public override void Render()
  {
    Engine.Instance.Renderer[RenderLayer].AnyMeshRenderer
      .Commit(Mesh, GameObject.Transform.FullTransformMatrix, Albedo);
  }
}