Exemple #1
0
        public void Draw(int lod = 0, bool motionBlur = false, bool forceNoBackfaceCulling = false, bool isSkyboxLol = false)
        {
            GFX.World.ApplyViewToShader(GFX.FlverShader, CurrentTransform);

            if (isSkyboxLol)
            {
                //((FlverShader)shader).Bones0 = new Matrix[] { Matrix.Identity };
                GFX.FlverShader.Effect.IsSkybox = true;
            }
            else
            {
                GFX.FlverShader.Effect.Bones0 = Skeleton.ShaderMatrices0;

                if (Skeleton.FlverSkeleton.Count >= FlverShader.MaxBonePerMatrixArray)
                {
                    GFX.FlverShader.Effect.Bones1 = Skeleton.ShaderMatrices1;

                    if (Skeleton.FlverSkeleton.Count >= FlverShader.MaxBonePerMatrixArray * 2)
                    {
                        GFX.FlverShader.Effect.Bones2 = Skeleton.ShaderMatrices2;

                        if (Skeleton.FlverSkeleton.Count >= FlverShader.MaxBonePerMatrixArray * 3)
                        {
                            GFX.FlverShader.Effect.Bones3 = Skeleton.ShaderMatrices3;

                            if (Skeleton.FlverSkeleton.Count >= FlverShader.MaxBonePerMatrixArray * 4)
                            {
                                GFX.FlverShader.Effect.Bones4 = Skeleton.ShaderMatrices4;

                                if (Skeleton.FlverSkeleton.Count >= FlverShader.MaxBonePerMatrixArray * 5)
                                {
                                    GFX.FlverShader.Effect.Bones5 = Skeleton.ShaderMatrices5;
                                }
                            }
                        }
                    }
                }

                GFX.FlverShader.Effect.IsSkybox = false;
            }

            if (IsVisible)
            {
                MainMesh.DrawMask = DrawMask;
                MainMesh.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (ChrAsm != null)
            {
                ChrAsm.Draw(DrawMask, lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }
        }
Exemple #2
0
        public void Draw(bool[] mask, int lod = 0, bool motionBlur = false, bool forceNoBackfaceCulling = false, bool isSkyboxLol = false)
        {
            if (HeadMesh != null)
            {
                HeadMesh.DrawMask = mask;
                HeadMesh?.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (BodyMesh != null)
            {
                BodyMesh.DrawMask = mask;
                BodyMesh?.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (ArmsMesh != null)
            {
                ArmsMesh.DrawMask = mask;
                ArmsMesh?.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (LegsMesh != null)
            {
                LegsMesh.DrawMask = mask;
                LegsMesh?.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (RightWeaponModel != null)
            {
                RightWeaponModel.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }

            if (LeftWeaponModel != null)
            {
                LeftWeaponModel.Draw(lod, motionBlur, forceNoBackfaceCulling, isSkyboxLol);
            }
        }