public CUDAGenerator(Device graphicsDevice, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.container = container;

            InitializeCUDA();
        }
Exemple #2
0
        public DirectComputeGenerator(Device graphicsDevice, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.container      = container;

            Initialize();
        }
        public DirectComputeGenerator(Device graphicsDevice, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.container = container;

            Initialize();
        }
Exemple #4
0
        public CUDAGenerator(Device graphicsDevice, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.container      = container;

            InitializeCUDA();
        }
Exemple #5
0
        /// <summary>
        /// Initializes object.
        /// </summary>
        /// <param name="graphicsDevice">Virtual adapter used to perform rendering.</param>
        /// <param name="camera">Reference to camera, which is used in some computations.</param>
        public VoxelMesh(Device graphicsDevice, Camera camera)
        {
            Container = new VoxelMeshContainer
            {
                Settings = new VoxelMeshSettings(graphicsDevice)
            };

            Renderer = new DefaultRenderer(graphicsDevice, camera, Container);
            Generator = new CPUGenerator(graphicsDevice, Container);
        }
Exemple #6
0
        /// <summary>
        /// Initializes object.
        /// </summary>
        /// <param name="graphicsDevice">Virtual adapter used to perform rendering.</param>
        /// <param name="camera">Reference to camera, which is used in some computations.</param>
        public VoxelMesh(Device graphicsDevice, Camera camera)
        {
            Container = new VoxelMeshContainer
            {
                Settings = new VoxelMeshSettings(graphicsDevice)
            };

            Renderer  = new DefaultRenderer(graphicsDevice, camera, Container);
            Generator = new CPUGenerator(graphicsDevice, Container);
        }
        public DefaultRenderer(Device graphicsDevice, Camera camera, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.camera = camera;
            this.container = container;

#if DEBUG
            shader = new Effect(graphicsDevice, ShaderPrecompiler.PrecompileOrLoad(@"Shaders\VoxelMesh.hlsl", "fx_5_0", ShaderFlags.Debug, EffectFlags.None));
#else
            shader = new Effect(graphicsDevice, ShaderPrecompiler.PrecompileOrLoad(@"Shaders\VoxelMesh.hlsl", "fx_5_0", ShaderFlags.None, EffectFlags.None));
#endif

            layout = new InputLayout(graphicsDevice, shader.GetTechniqueByIndex(0).GetPassByIndex(0).Description.Signature, new[]
			{
				new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0, InputClassification.PerVertexData, 0),
				new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0, InputClassification.PerVertexData, 0),
				new InputElement("AMBIENT", 0, Format.R32_Float, 24, 0, InputClassification.PerVertexData, 0)
			});
        }
        public DefaultRenderer(Device graphicsDevice, Camera camera, VoxelMeshContainer container)
        {
            this.graphicsDevice = graphicsDevice;
            this.camera         = camera;
            this.container      = container;

#if DEBUG
            shader = new Effect(graphicsDevice, ShaderPrecompiler.PrecompileOrLoad(@"Shaders\VoxelMesh.hlsl", "fx_5_0", ShaderFlags.Debug, EffectFlags.None));
#else
            shader = new Effect(graphicsDevice, ShaderPrecompiler.PrecompileOrLoad(@"Shaders\VoxelMesh.hlsl", "fx_5_0", ShaderFlags.None, EffectFlags.None));
#endif

            layout = new InputLayout(graphicsDevice, shader.GetTechniqueByIndex(0).GetPassByIndex(0).Description.Signature, new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0, InputClassification.PerVertexData, 0),
                new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0, InputClassification.PerVertexData, 0),
                new InputElement("AMBIENT", 0, Format.R32_Float, 24, 0, InputClassification.PerVertexData, 0)
            });
        }
Exemple #9
0
 public CPUGenerator(Device graphicsDevice, VoxelMeshContainer container)
 {
     this.graphicsDevice = graphicsDevice;
     this.container      = container;
 }
Exemple #10
0
 public CPUGenerator(Device graphicsDevice, VoxelMeshContainer container)
 {
     this.graphicsDevice = graphicsDevice;
     this.container = container;
 }