Пример #1
0
 /// <summary>
 /// Renders the given <see cref="ModelPreviewSection"/> of a <see cref="ModelPreviewLOD"/>.
 /// </summary>
 /// <param name="lod">The LOD to render.</param>
 /// <param name="s">Which faces to render.</param>
 /// <param name="transform">The model transformation to be applied to the vertices.</param>
 /// <param name="view">The SceneRenderControl that the given LOD should be rendered into.</param>
 public override void RenderSection(ModelPreviewLOD lod, ModelPreviewSection s, Matrix transform, SceneRenderContext context)
 {
     context.DefaultEffect.PrepDraw(context.ImmediateContext);
     context.DefaultEffect.RenderObject(context.ImmediateContext, new SceneRenderContext.WorldConstants(Matrix.Transpose(context.Camera.ProjectionMatrix), Matrix.Transpose(context.Camera.ViewMatrix), Matrix.Transpose(transform)), lod.Mesh, (int)s.StartIndex, (int)s.TriangleCount * 3, Textures.ContainsKey(DiffuseTextureFullName) ? Textures[DiffuseTextureFullName]?.TextureView ?? context.DefaultTextureView : context.DefaultTextureView);
 }
Пример #2
0
 /// <summary>
 /// Renders the given <see cref="ModelPreviewSection"/> of a <see cref="ModelPreviewLOD"/>.
 /// </summary>
 /// <param name="lod">The LOD to render.</param>
 /// <param name="s">Which faces to render.</param>
 /// <param name="transform">The model transformation to be applied to the vertices.</param>
 /// <param name="view">The SceneRenderControl that the given LOD should be rendered into.</param>
 public abstract void RenderSection(ModelPreviewLOD lod, ModelPreviewSection s, Matrix transform, SceneRenderContext context);