Add Phong lighting (WIP)

This commit is contained in:
Jérôme Leclercq
2022-01-11 19:47:29 +01:00
parent 504249e70f
commit b0a3941f4e
40 changed files with 1141 additions and 427 deletions

View File

@@ -89,7 +89,7 @@ namespace Nz
inline void Sprite::UpdateVertices()
{
Boxf aabb;
Boxf aabb = Boxf::Zero();
VertexStruct_XYZ_Color_UV* vertices = m_vertices.data();
@@ -105,7 +105,10 @@ namespace Nz
vertices->position = Vector3f(m_size * cornerExtent[UnderlyingCast(corner)], 0.f) - m_origin;
vertices->uv = m_textureCoords.GetCorner(corner);
aabb.Set(vertices->position);
if (aabb.IsValid())
aabb.ExtendTo(vertices->position);
else
aabb.Set(vertices->position);
vertices++;
}