/// <summary> /// Draws a mesh immediately with no transform setup /// </summary> /// <param name="mesh"></param> /// <param name="submesh"></param> public void DrawImmediate(Mesh mesh, int submesh) { // Sanity check if (activematerial == null) return; // Setup the material activematerial.Shader.Effect.GetTechniqueByIndex(0).GetPassByIndex(0).Apply(context); // Setup the mesh if (!mesh.Render(activematerial.Shader, submesh)) { mesh.Upload(Device, context); mesh.Render(activematerial.Shader, submesh); } }
/// <summary> /// Draws a mesh immediately /// </summary> /// <param name="mesh"></param> /// <param name="submesh"></param> /// <param name="material"></param> /// <param name="transform"></param> public void DrawImmediate(Mesh mesh, int submesh, Matrix projectionview, Matrix transform) { // Sanity check if (activematerial == null) return; // Setup the material Shader shader = activematerialshadow ? activematerial.ShadowShader : activematerial.Shader; if (shader == null) return; shader.SetVariable("projectionview", projectionview); shader.SetVariable("transform", transform); shader.DefaultPass.Apply(context); // Setup the mesh if (!mesh.Render(shader, submesh)) { mesh.Upload(Device, context); mesh.Render(shader, submesh); } frame_drawcalls++; }