internal void Render() { mTerMats.ApplyMaterialPass("Sky", mGD.DC, 0); mSkyCube.Draw(mGD.DC); if (mTerrain != null) { mTerrain.Draw(mGD, mTerMats, mFrust); } mDrawRays.Draw(mOtherCam); mST.Draw(mGD.DC, Matrix.Identity, mTextProj); }
internal void Render() { mTerMats.ApplyMaterialPass("Sky", mGD.DC, 0); mSkyCube.Draw(mGD.DC); if (mTerrain != null) { mTerrain.Draw(mGD, mTerMats, mFrust); } if (mQTreeBoxes != null) { mDebugMats.ApplyMaterialPass("DebugBoxes", mGD.DC, 0); mQTreeBoxes.Draw(mGD.DC); } mST.Draw(mGD.DC, Matrix.Identity, mTextProj); }
public void Draw(GraphicsDevice gd) { if (gd.DC == null) { return; } if (mVB == null) { return; } mMatLib.SetParameterForAll("mLightDirection", -mLightDir); mMatLib.SetParameterForAll("mView", gd.GCam.View); mMatLib.SetParameterForAll("mEyePos", gd.GCam.Position); mMatLib.SetParameterForAll("mProjection", gd.GCam.Projection); mMatLib.ApplyMaterialPass("FacePoints", gd.DC, 0); gd.DC.InputAssembler.SetVertexBuffers(0, mVBBinding); gd.DC.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.LineList; gd.DC.Draw(mVertCount, 0); gd.DC.InputAssembler.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList; mMatLib.SetMaterialParameter("RedAxis", "mWorld", mCenter); mMatLib.SetMaterialParameter("GreenAxis", "mWorld", mCenter); //X axis red mMatLib.ApplyMaterialPass("RedAxis", gd.DC, 0); mTexU.Draw(gd.DC); //Y axis green mMatLib.ApplyMaterialPass("GreenAxis", gd.DC, 0); mTexV.Draw(gd.DC); mMatLib.SetMaterialParameter("LMPlane", "mWorld", mPlaneWorld); mMatLib.SetMaterialParameter("LMPlane", "mView", Matrix.Identity); mMatLib.SetMaterialParameter("LMPlane", "mProjection", mPlaneProj); mMatLib.ApplyMaterialPass("LMPlane", gd.DC, 0); mLMPlane.Draw(gd.DC); }
internal void Draw(GameCamera cam) { if (mVBRays == null) { return; } mMatLib.UpdateWVP(Matrix.Identity, cam.View, cam.Projection, cam.Position); mMatLib.ApplyMaterialPass("RayGeometry", mGD.DC, 0); if (mVBRays != null) { mGD.DC.InputAssembler.SetVertexBuffers(0, mVBBRays); mGD.DC.InputAssembler.SetIndexBuffer(mIBRays, Format.R32_UInt, 0); mGD.DC.DrawIndexed(mRaysIndexCount, 0, 0); } if (mHits != null) { mHits.Draw(mGD.DC); } }