Refactor MeshInstance

This commit is contained in:
2026-03-13 15:10:25 +09:00
parent 619720feee
commit 8a3b40b4f8
15 changed files with 57 additions and 61 deletions

View File

@@ -1,47 +1,15 @@
using Ghost.Core;
using Ghost.Entities;
using Ghost.Graphics.Core;
using Misaki.HighPerformance.LowLevel.Collections;
namespace Ghost.Engine.Components;
public struct MeshPalette : ISharedComponent, IEquatable<MeshPalette>
{
public UnsafeArray<Handle<Mesh>> meshes;
public UnsafeArray<Handle<Material>> materials;
public bool Equals(MeshPalette other)
{
throw new NotImplementedException();
}
public override int GetHashCode()
{
throw new NotImplementedException();
}
public override bool Equals(object? obj)
{
return obj is MeshPalette palette && Equals(palette);
}
public static bool operator ==(MeshPalette left, MeshPalette right)
{
return left.Equals(right);
}
public static bool operator !=(MeshPalette left, MeshPalette right)
{
return !(left == right);
}
}
public struct MeshInstance : IComponent
{
public int meshIndex;
public int materialIndex;
public Handle<Mesh> mesh;
// NOTE: This will be the first material, we can access other materials by the bindless index of the first material + the local index stored in the meshlet.
public Handle<Material> materialStart;
public ShadowCastingMode shadowCastingMode;
public RenderingLayerMask renderingLayerMask;
public byte subMeshIndex;
public bool staticShadowCaster;
}