protected void SetupRenderer() { try { Renderable.Initialize(Device); FieldPlane.Initialize(); ColorMapping.Initialize(Device); PointCloud.Initialize(); LineBall.Initialize(); Mesh.Initialize(); Device.ImmediateContext.OutputMerger.SetTargets(_host.RenderTargetView); Device.ImmediateContext.Rasterizer.SetViewports(new Viewport(0, 0, _host.RenderTargetWidth, _host.RenderTargetHeight, 0.0f, 1.0f)); _renderables = new List <Renderable>(); Camera = new Camera(Device, ((float)_host.RenderTargetWidth) / _host.RenderTargetHeight); var desc = new RasterizerStateDescription { CullMode = CullMode.None, FillMode = FillMode.Solid }; Device.ImmediateContext.Rasterizer.State = RasterizerState.FromDescription(Device, desc); SetupCuda(); AlgorithmCuda.Initialize(ContextCuda, Device); FlowMapUncertain.Initialize(); CutDiffusion.Initialize(); LocalDiffusion.Initialize(); } catch (Exception e) { Console.WriteLine(e); } }
public DiffusionMapper(VectorFieldUnsteady velocity, Plane plane) : base(plane, velocity.Size.ToInt2()) { _diffusionMap = new CutDiffusion(velocity, 0, 0.3f); _algorithm = _diffusionMap; Plane = plane; _subrangePlane = Plane; Mapping = GetCurrentMap; _velocity = velocity; _maxPlane = velocity.Size.ToInt2(); _scaledPlane = new Plane(_subrangePlane.Origin, _subrangePlane.XAxis, _subrangePlane.YAxis, _subrangePlane.ZAxis, 1.0f / _cellToSeedRatio, _subrangePlane.PointSize); }