public override void LoadResources() { string base_path = (string)settings["Base.Path"]; // load effect string errors; effect1 = Effect.FromFile(device, base_path + "Media/Effects/LightEffects.fx", null, null, ShaderFlags.None, null, out errors); if (errors.Length > 0) { throw new Exception("HLSL compile error"); } effect2 = Effect.FromFile(device, base_path + "Media/Effects/PPLightEffects.fx", null, null, ShaderFlags.None, null, out errors); if (errors.Length > 0) { throw new Exception("HLSL compile error"); } Stream stream = null; Stream hmStream = null; NoiseTextureParams param = new NoiseTextureParams(512, 256, false, new PerlinModuleWrapper(), false); NoiseTextureBuilder.BuildSphericalTexture(param, ref stream, ref hmStream); testTexture = TextureLoader.FromStream(device, stream); stream.Dispose(); //testTexture = TextureLoader.FromFile(device, "c:/earth.bmp"); }
private void button1_Click(object sender, EventArgs e) { Stream stream = null; NoiseTextureBuilder.BuildSphericalTexture(null, ref stream, ref stream); pictureBox1.Image = Bitmap.FromStream(stream); stream.Close(); }