public RenderModel(RenderPipeline pipeline, Model model) { if (pipeline == null) { throw new ArgumentNullException("pipeline"); } Pipeline = pipeline; Model = model; var slotCount = Pipeline.GetOrCreateModelRendererState().ModelSlotCount; RenderMeshes = new List <RenderMesh> [slotCount]; }
/// <summary> /// Initializes a new instance of the <see cref="RenderModel" /> class. /// </summary> /// <param name="pipeline">The pipeline.</param> /// <param name="modelInstance">The model instance.</param> /// <exception cref="System.ArgumentNullException">pipeline</exception> public RenderModel(RenderPipeline pipeline, IModelInstance modelInstance) { if (pipeline == null) { throw new ArgumentNullException("pipeline"); } Pipeline = pipeline; ModelInstance = modelInstance; Model = modelInstance.Model; Parameters = modelInstance.Parameters; var modelRendererState = Pipeline.GetOrCreateModelRendererState(); var slotCount = modelRendererState.ModelSlotCount; RenderMeshes = new List <RenderMesh> [slotCount]; if (Model != null) { modelRendererState.PrepareRenderModel(this); } }