Exemple #1
0
        private static Material LoadComputeShader(SharpDX.Toolkit.Graphics.GraphicsDevice device)
        {
            MaterialLoader      loader = new MaterialLoader(new SharpDXGraphicsDevice(device));
            ResourceInformation info   = new MaterialResourceInformation();

            info.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Shaders\\ComputeTest.fx");
            info.UpdateInformation("Technique", "FillTexture");

            return((Material)loader.Load(info));
        }
        private Material LoadComputeShader(FearGraphicsDevice device)
        {
            MaterialLoader      loader = new MaterialLoader(device);
            ResourceInformation info   = new MaterialResourceInformation();

            info.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Shaders\\ComputeIrradiance.fx");
            info.UpdateInformation("Technique", "ComputeIrradianceMips");

            return((Material)loader.Load(info));
        }
        public void LoadComputeShader()
        {
            //Given
            SharpDX.Toolkit.Graphics.GraphicsDevice device = SharpDX.Toolkit.Graphics.GraphicsDevice.New(DeviceCreationFlags.Debug);
            MaterialLoader      loader = new MaterialLoader(new SharpDXGraphicsDevice(device));
            ResourceInformation info   = new MaterialResourceInformation();

            info.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Shaders\\ComputeTest.fx");
            info.UpdateInformation("Technique", "FillTexture");

            //When
            Material material = (Material)loader.Load(info);

            //Then
            Assert.IsTrue(material.IsLoaded());

            device.Dispose();
        }