Exemplo n.º 1
0
 protected virtual void ProcessIndexBuffer(DynamicModelContent dynamicModel, ContentProcessorContext context, DynamicModelMeshPartContent part)
 {
     if (IndexBufferType != DynamicModelContent.BufferType.Default)
     {
         DynamicIndexBufferContent ib;
         if (!_indexBufferCache.TryGetValue(part.IndexBuffer, out ib))
         {
             ib             = new DynamicIndexBufferContent(part.IndexBuffer);
             ib.IsWriteOnly = (IndexBufferType == DynamicModelContent.BufferType.DynamicWriteOnly);
             _indexBufferCache[part.IndexBuffer] = ib;
         }
         part.IndexBuffer = ib;
     }
 }
Exemplo n.º 2
0
 protected virtual void ProcessVertexBuffer(DynamicModelContent dynamicModel, ContentProcessorContext context, DynamicModelMeshPartContent part)
 {
     if (VertexBufferType != DynamicModelContent.BufferType.Default)
     {
         // Replace the default VertexBufferContent with CpuAnimatedVertexBufferContent.
         DynamicVertexBufferContent vb;
         if (!_vertexBufferCache.TryGetValue(part.VertexBuffer, out vb))
         {
             vb             = new DynamicVertexBufferContent(part.VertexBuffer);
             vb.IsWriteOnly = (VertexBufferType == DynamicModelContent.BufferType.DynamicWriteOnly);
             _vertexBufferCache[part.VertexBuffer] = vb;
         }
         part.VertexBuffer = vb;
     }
 }