static void UpdateVoxelSlices(ref MyVoxelMaterialEntry entry, IDynamicFileArrayTexture cm, string[] cmXZnY, string[] cmY, IDynamicFileArrayTexture ng, string[] ngXZnY, string[] ngY, IDynamicFileArrayTexture ext, string[] extXZnY, string[] extY) { int index = 0; entry.SliceNear1.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceNear1.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceNear1.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceNear1.W = ng.GetOrAddSlice(ngY[index]); entry.SliceNear2.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceNear2.Y = ext.GetOrAddSlice(extY[index]); index = 1; entry.SliceFar1.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceFar1.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceFar1.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceFar1.W = ng.GetOrAddSlice(ngY[index]); entry.SliceFar2.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceFar2.Y = ext.GetOrAddSlice(extY[index]); index = 2; entry.SliceFar21.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceFar21.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceFar21.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceFar21.W = ng.GetOrAddSlice(ngY[index]); entry.SliceFar22.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceFar22.Y = ext.GetOrAddSlice(extY[index]); }
static void FillVoxelMaterialEntry(ref MyVoxelMaterialEntry entry, ref MyVoxelMaterial1 voxelMaterial1) { entry.DistancesAndScale = voxelMaterial1.DistanceAndScale; entry.DistancesAndScaleFar = new Vector3(voxelMaterial1.DistanceAndScaleFar.X, voxelMaterial1.DistanceAndScaleFar.Y, 1); entry.DistancesAndScaleFar2 = new Vector3(voxelMaterial1.DistanceAndScaleFar.Z, voxelMaterial1.DistanceAndScaleFar.W, 2); entry.DistancesAndScaleFar3 = new Vector3(voxelMaterial1.DistanceAndScaleFar3.X, voxelMaterial1.DistanceAndScaleFar3.Y, 3); entry.Far3Color = voxelMaterial1.Far3Color; entry.ExtensionDetailScale = voxelMaterial1.ExtensionDetailScale; IDynamicFileArrayTexture texColorMetal = MyGlobalResources.FileArrayTextureVoxelCM; IDynamicFileArrayTexture texNormalGloss = MyGlobalResources.FileArrayTextureVoxelNG; IDynamicFileArrayTexture texExt = MyGlobalResources.FileArrayTextureVoxelExt; MyVoxelMaterialDetailSet set = voxelMaterial1.Resource; UpdateVoxelSlices(ref entry, texColorMetal, set.ColorMetalXZnY_Filepaths, set.ColorMetalY_Filepaths, texNormalGloss, set.NormalGlossXZnY_Filepaths, set.NormalGlossY_Filepaths, texExt, set.ExtY_Filepaths, set.ExtY_Filepaths); }
static void ResetVoxelMaterialEntry(out MyVoxelMaterialEntry entry) { MyVoxelMaterialEntry zero = new MyVoxelMaterialEntry(); entry = zero; }
static void FillVoxelMaterialEntry(ref MyVoxelMaterialEntry entry, ref MyVoxelMaterial1 voxelMaterial1) { entry.DistancesAndScale = voxelMaterial1.DistanceAndScale; entry.DistancesAndScaleFar = new Vector3(voxelMaterial1.DistanceAndScaleFar.X, voxelMaterial1.DistanceAndScaleFar.Y, 1); entry.DistancesAndScaleFar2 = new Vector3(voxelMaterial1.DistanceAndScaleFar.Z, voxelMaterial1.DistanceAndScaleFar.W, 2); entry.DistancesAndScaleFar3 = new Vector3(voxelMaterial1.DistanceAndScaleFar3.X, voxelMaterial1.DistanceAndScaleFar3.Y, 3); entry.Far3Color = voxelMaterial1.Far3Color; entry.ExtensionDetailScale = voxelMaterial1.ExtensionDetailScale; IDynamicFileArrayTexture texColorMetal = MyGlobalResources.FileArrayTextureVoxelCM; IDynamicFileArrayTexture texNormalGloss = MyGlobalResources.FileArrayTextureVoxelNG; IDynamicFileArrayTexture texExt = MyGlobalResources.FileArrayTextureVoxelExt; MyVoxelMaterialDetailSet set = voxelMaterial1.Resource; UpdateVoxelSlices(ref entry, texColorMetal, set.ColorMetalXZnY_Filepaths, set.ColorMetalY_Filepaths, texNormalGloss, set.NormalGlossXZnY_Filepaths, set.NormalGlossY_Filepaths, texExt, set.ExtY_Filepaths, set.ExtY_Filepaths); }
static void UpdateVoxelSlices(ref MyVoxelMaterialEntry entry, IDynamicFileArrayTexture cm, string[] cmXZnY, string[] cmY, IDynamicFileArrayTexture ng, string[] ngXZnY, string[] ngY, IDynamicFileArrayTexture ext, string[] extXZnY, string[] extY) { int index = 0; entry.SliceNear1.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceNear1.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceNear1.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceNear1.W = ng.GetOrAddSlice(ngY[index]); entry.SliceNear2.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceNear2.Y = ext.GetOrAddSlice(extY[index]); index = 1; entry.SliceFar1.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceFar1.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceFar1.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceFar1.W = ng.GetOrAddSlice(ngY[index]); entry.SliceFar2.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceFar2.Y = ext.GetOrAddSlice(extY[index]); index = 2; entry.SliceFar21.X = cm.GetOrAddSlice(cmXZnY[index]); entry.SliceFar21.Y = cm.GetOrAddSlice(cmY[index]); entry.SliceFar21.Z = ng.GetOrAddSlice(ngXZnY[index]); entry.SliceFar21.W = ng.GetOrAddSlice(ngY[index]); entry.SliceFar22.X = ext.GetOrAddSlice(extXZnY[index]); entry.SliceFar22.Y = ext.GetOrAddSlice(extY[index]); }
static void ResetVoxelMaterialEntry(out MyVoxelMaterialEntry entry) { MyVoxelMaterialEntry zero = new MyVoxelMaterialEntry(); entry = zero; }