public LMUVViewer(Lumen Lm, NUT Nut, int ShapeIndex, int GraphicIndex) { lumen = Lm; nut = Nut; shapeIndex = ShapeIndex; graphicIndex = GraphicIndex; InitializeComponent(); }
public LmuvViewer(Lumen lm, NUT nut, int shapeIndex, int graphicIndex) { lumen = lm; this.nut = nut; this.shapeIndex = shapeIndex; this.graphicIndex = graphicIndex; InitializeComponent(); }
private void OpenBackgroundTexture() { using (var ofd = new OpenFileDialog() { Filter = "Image (.png)|*.png|All Files (*.*)|*.*" }) { if (ofd.ShowDialog() == DialogResult.OK) { Rendering.RenderTools.backgroundTexture = NUT.loadImage(new Bitmap(ofd.FileName)); Runtime.backgroundTexFilePath = ofd.FileName; backgroundPictureBox.Image = new Bitmap(Runtime.backgroundTexFilePath); } } }
private void OpenFloorTexture() { using (var ofd = new OpenFileDialog() { Filter = "Image (.png)|*.png|All Files (*.*)|*.*" }) { if (ofd.ShowDialog() == DialogResult.OK) { Bitmap floorImg = new Bitmap(ofd.FileName); Runtime.floorTexFilePath = ofd.FileName; floorColorPictureBox.Image = floorImg; floorColorPictureBox.Refresh(); Rendering.RenderTools.floorTexture = NUT.loadImage(floorImg); } } }
public static void LoadTextures() { dummyTextures = CreateNudDummyTextures(); NudMatSphereDrawing.LoadMaterialSphereTextures(); // Helpful textures. uvTestPattern = new Texture2D(); uvTestPattern.LoadImageData(Properties.Resources.UVPattern); uvTestPattern.TextureWrapS = TextureWrapMode.Repeat; uvTestPattern.TextureWrapT = TextureWrapMode.Repeat; // TODO: Simplify this conversion. DDS specularSdr = new DDS(new FileData(Properties.Resources.specularSDR)); specularPbr = NUT.CreateTextureCubeMap(specularSdr.ToNutTexture()); DDS diffuseSdr = new DDS(new FileData(Properties.Resources.diffuseSDR)); diffusePbr = NUT.CreateTextureCubeMap(diffuseSdr.ToNutTexture()); // Don't use mipmaps. diffusePbr.MinFilter = TextureMinFilter.Linear; diffusePbr.MagFilter = TextureMagFilter.Linear; boneWeightGradient = new Texture2D(); boneWeightGradient.LoadImageData(Properties.Resources.boneWeightGradient); boneWeightGradient2 = new Texture2D(); boneWeightGradient2.LoadImageData(Properties.Resources.boneWeightGradient2); defaultTex = new Texture2D(); defaultTex.LoadImageData(Resources.Resources.DefaultTexture); try { floorTexture = new Texture2D(); floorTexture.LoadImageData(new Bitmap(Runtime.floorTexFilePath)); backgroundTexture = new Texture2D(); backgroundTexture.LoadImageData(new Bitmap(Runtime.backgroundTexFilePath)); } catch (Exception) { // File paths are incorrect or never set. } }
public static void LoadNextNut(string nudFileName, ModelContainer modelContainer) { string fileName = nudFileName.Replace("nud", "nut"); try { NUT newNut = new NUT(fileName); Runtime.TextureContainers.Add(newNut); // Free memory used by OpenTK. modelContainer.NUT.Destroy(); modelContainer.NUT = newNut; } catch (Exception e) { // A few nuts still don't open properly, so just skip them. Debug.WriteLine(e.Message); } }