Exemplo n.º 1
0
        private String _GetDebugWarnings()
        {
            var sb = new StringBuilder();

            if (Geometry.TryGetNormal(out Vector3 n))
            {
                if (!n.IsValidNormal())
                {
                    sb.Append($" ❌𝚴:{n}");
                }
            }

            if (Geometry.TryGetTangent(out Vector4 t))
            {
                if (!t.IsValidTangent())
                {
                    sb.Append($" ❌𝚻:{t}");
                }
            }

            for (int i = 0; i < Material.MaxColors; ++i)
            {
                var c = Material.GetColor(i);
                if (!c._IsFinite() | !c.IsInRange(Vector4.Zero, Vector4.One))
                {
                    sb.Append($" ❌𝐂{i}:{c}");
                }
            }

            for (int i = 0; i < Material.MaxTextCoords; ++i)
            {
                var uv = Material.GetTexCoord(i);
                if (!uv._IsFinite())
                {
                    sb.Append($" ❌𝐔𝐕{i}:{uv}");
                }
            }

            for (int i = 0; i < Skinning.MaxBindings; ++i)
            {
                var jw = Skinning.GetJointBinding(i);
                if (!jw.Weight._IsFinite() || jw.Weight < 0 || jw.Index < 0)
                {
                    sb.Append($" ❌𝐉𝐖{i} {jw.Index}:{jw.Weight}");
                }
            }

            return(sb.ToString());
        }