public MeshRenderer(Device device, MeshCache meshCache, ShaderCache cache, int maximumInstancesPerDraw = 2048) { this.meshCache = meshCache; instances = new StructuredBuffer <MeshInstance>(device, maximumInstancesPerDraw, $"Mesh Instances"); vertexConstants = new ConstantsBuffer <RasterizedVertexConstants>(device, debugName: $"Mesh Renderer Vertex Constants"); vertexShader = new VertexShader(device, cache.GetShader(@"ShapeDrawing\RenderMeshes.hlsl.vshader")); pixelShader = new PixelShader(device, cache.GetShader(@"ShapeDrawing\RenderMeshes.hlsl.pshader")); }
public ShapesExtractor(Device device, ParallelLooper looper, BufferPool pool, int initialCapacityPerShapeType = 1024) { spheres = new QuickList <SphereInstance>(initialCapacityPerShapeType, pool); capsules = new QuickList <CapsuleInstance>(initialCapacityPerShapeType, pool); cylinders = new QuickList <CylinderInstance>(initialCapacityPerShapeType, pool); boxes = new QuickList <BoxInstance>(initialCapacityPerShapeType, pool); triangles = new QuickList <TriangleInstance>(initialCapacityPerShapeType, pool); meshes = new QuickList <MeshInstance>(initialCapacityPerShapeType, pool); this.MeshCache = new MeshCache(device, pool); this.pool = pool; this.looper = looper; }