Example #1
0
        internal void Render(DeviceContext dc)
        {
            foreach (Character c in mCharacters)
            {
                c.Draw(dc, mCharMats);
            }

            foreach (StaticMesh sm in mMeshes)
            {
                sm.Draw(dc, mStaticMats);
            }

            for (int i = 0; i < mCharacters.Count; i++)
            {
                foreach (KeyValuePair <int, Matrix> bone in mCBones[i])
                {
                    Matrix boneTrans = bone.Value;

                    if (bone.Key == mCBone[i])
                    {
                        mCPrims.DrawBox(dc, bone.Key, boneTrans * mCharacters[i].GetTransform(), mHitColor);
                    }
                    else
                    {
                        mCPrims.DrawBox(dc, bone.Key, boneTrans * mCharacters[i].GetTransform(), Vector4.One * 0.5f);
                    }
                }
            }

            int idx = 10000;

            for (int i = 0; i < mMeshes.Count; i++)
            {
                StaticMesh sm = mMeshes[i];

                Matrix mat = sm.GetTransform();

                Dictionary <Mesh, BoundingBox> bnd = mMeshBounds[i];

                foreach (KeyValuePair <Mesh, BoundingBox> b in bnd)
                {
                    if (b.Key == mPartHit && mMeshHit == sm)
                    {
                        mCPrims.DrawBox(dc, idx++, b.Key.GetTransform() * mat, mHitColor);
                    }
                    else
                    {
                        mCPrims.DrawBox(dc, idx++, b.Key.GetTransform() * mat, Vector4.One * 0.5f);
                    }
                }
            }

            mCPrims.DrawAxis(dc);

            mSUI.Draw(dc, Matrix.Identity, mTextProj);
            mST.Draw(dc, Matrix.Identity, mTextProj);
        }
Example #2
0
        internal void Render()
        {
            mPost.SetTargets(mGD, "SceneDepthMatNorm", "SceneDepth");

            mPost.ClearTarget(mGD, "SceneDepthMatNorm", Color.White);
            mPost.ClearDepth(mGD, "SceneDepth");

            mZoneDraw.DrawDMN(mGD, mZone.IsMaterialVisibleFromPos,
                              mZone.GetModelTransform, RenderExternalDMN);

            mPost.SetTargets(mGD, "SceneColor", "SceneDepth");

            mPost.ClearTarget(mGD, "SceneColor", Color.CornflowerBlue);
            mPost.ClearDepth(mGD, "SceneDepth");

            if (mDynLights != null)
            {
                mDynLights.SetParameter();
            }

            mZoneDraw.Draw(mGD, mShadowHelper.GetShadowCount(),
                           mZone.IsMaterialVisibleFromPos,
                           mZone.GetModelTransform,
                           RenderExternal,
                           mShadowHelper.DrawShadows,
                           SetUpAlphaRenderTargets);

            mPost.SetTargets(mGD, "Outline", "null");
            mPost.SetParameter("mNormalTex", "SceneDepthMatNorm");
            mPost.DrawStage(mGD, "Outline");

            mPost.SetTargets(mGD, "Bloom1", "null");
            mPost.SetParameter("mBlurTargetTex", "SceneColor");
            mPost.DrawStage(mGD, "BloomExtract");

            mPost.SetTargets(mGD, "Bloom2", "null");
            mPost.SetParameter("mBlurTargetTex", "Bloom1");
            mPost.DrawStage(mGD, "GaussianBlurX");

            mPost.SetTargets(mGD, "Bloom1", "null");
            mPost.SetParameter("mBlurTargetTex", "Bloom2");
            mPost.DrawStage(mGD, "GaussianBlurY");

            mPost.SetTargets(mGD, "Bleach", "null");
            mPost.SetParameter("mBlurTargetTex", "Bloom1");
            mPost.SetParameter("mColorTex", "SceneColor");
            mPost.DrawStage(mGD, "BloomCombine");

            mPost.SetTargets(mGD, "BackColor", "BackDepth");
            mPost.SetParameter("mBlurTargetTex", "Outline");
            mPost.SetParameter("mColorTex", "Bleach");
            mPost.DrawStage(mGD, "Modulate");

            mUI.Draw(mGD.DC, Matrix.Identity, mTextProj);
            mST.Draw(mGD.DC, Matrix.Identity, mTextProj);
        }
Example #3
0
        internal void Render(GraphicsDevice gd)
        {
            if (mDBDraw != null && mbDrawWorld)
            {
                mDBDraw.Draw(gd);
            }
            if (mDS != null)
            {
                mDS.Draw(gd);
            }

            mSUI.Draw(mGD.DC, Matrix.Identity, mTextProj);
            mST.Draw(mGD.DC, Matrix.Identity, mTextProj);
        }