public override void Render(Graphics2D.IRenderConfiguration renderConfig, RenderManager renderManager, IMaterial materialToUse) { /*if (StaticMesh.IsCollisionOnly) * { * return; * }*/ base.Render(renderConfig, renderManager, materialToUse); Performance.StartAppendAggreate("Setup"); Matrix worldViewProj = WorldMatrix * renderManager.ViewTarget.ViewMatrix * renderManager.ViewTarget.ProjectionMatrix; materialToUse.ApplyParameters(worldViewProj); Performance.EndAppendAggreate("Setup"); /*if (StaticMesh.DiffuseTexture != null) * { * Performance.StartAppendAggreate("Setup Texture"); * materialToUse.Effect.Parameters["Texture"].SetValue(StaticMesh.DiffuseTexture); * materialToUse.Effect.CurrentTechnique.Passes[0].Apply(); * Performance.EndAppendAggreate("Setup Texture"); * }*/ Performance.StartAppendAggreate("Render Mesh"); StaticMesh.Render(); Performance.EndAppendAggreate("Render Mesh"); }
public override void Render(IRenderConfiguration renderConfig, RenderManager renderManager, IMaterial materialToUse) { base.Render(renderConfig, renderManager, materialToUse); Performance.StartAppendAggreate("Setup"); Matrix worldViewProj = WorldMatrix * renderManager.ViewTarget.ViewMatrix * renderManager.ViewTarget.ProjectionMatrix; materialToUse.ApplyParameters(worldViewProj); Performance.EndAppendAggreate("Setup"); Performance.StartAppendAggreate("Render Mesh"); //SkeletalMesh.Render(); Performance.EndAppendAggreate("Render Mesh"); /*SkeletalMesh.SetAnimationTime(AnimationTime); * for (int i = 0; i < SkeletalMesh.MeshParts.Count; i++) * { * RenderMeshPart(SkeletalMesh.MeshParts[i], renderManager, renderConfig, materialToUse); * } * * for (int i = 0; i < SkeletalMesh.RootBone.ChildBones.Length; i++) * { * //DrawBone(SkeletalMesh.RootBone.ChildBones[i], renderManager, renderConfig); * }*/ }