/// <summary> /// Initializes application. /// </summary> public override void Initialize() { base.Initialize(); TexturePack pack = new TexturePack(); pack.Color = LoadTexture(@"Textures\tex_detail_color.dds"); pack.Bump = LoadTexture(@"Textures\tex_detail_bump.dds"); textures.Add(pack); for (int i = 1; i <= 19; i++) { pack = new TexturePack(); pack.Color = LoadTexture(@"Textures\tex_" + i + @"_color.dds"); pack.Bump = LoadTexture(@"Textures\tex_" + i + @"_bump.dds"); pack.Disp = LoadTexture(@"Textures\tex_" + i + @"_disp.dds"); textures.Add(pack); } voxelTerrain = new VoxelMesh(graphicsDevice, camera); VoxelMeshSettings settings = voxelTerrain.Container.Settings; settings.DetailTexture = textures[0]; settings.Texture1 = textures[1]; settings.Texture2 = textures[2]; settings.Texture3 = textures[3]; voxelTerrain.Container.Settings = settings; skyCube = new SkyCube(graphicsDevice, camera); }
public VoxelMeshSettings(Device graphicsDevice) { AmbientSamplesCount = 16; AmbientRayWidth = 20; DiffuseLight1 = new Vector3(-1, -1, -1); DiffuseLight2 = new Vector3(1, -1, -1); DiffuseLight3 = new Vector3(-1, -1, 1); TextureCoordinates = new Vector4(32, 32, 32, 1); DisplacementPower = new Vector3(1, 1, 1); ColorizationTexture = new NoiseCube(16, 16, 16).ToTexture3D(graphicsDevice); BumpPower = new Vector4(1, 1, 1, 1); TessellationFactor = new Vector4(1, 8, 15, 30); LevelOfDetail = 1; DiffuseIntensity = new Vector3(1, 1, 1); SpecularIntensity = new Vector3(1, 1, 1); SpecularRange = new Vector3(8, 8, 8); FogSettings = new Vector2(25, 100); Texture1 = new TexturePack(); Texture2 = new TexturePack(); Texture3 = new TexturePack(); DetailTexture = new TexturePack(); FogTexture = null; }