Ejemplo n.º 1
0
        public bool OnRestore()
        {
            Dispose();

            //parse
            _mesh_parser.Create(_object_file_path, _device);
            _mesh_object = _mesh_parser.GetMeshObj();

            // initialize the effect
            _effect = Effect.FromFile(_device, @"Shader/MeshFromOBJ10.fx", "fx_4_0", ShaderFlags.EnableStrictness | ShaderFlags.Debug, EffectFlags.None);
            EffectTechnique technique = _effect.GetTechniqueByIndex(0);
            EffectPass pass = technique.GetPassByIndex(0);
            _input_layout = new InputLayout(_device, pass.Description.Signature, PositionNormalTextureVertex.InputElements);

            return true;
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine($"\n> BFRES Injector v2.0a\n" +
                              "> Made by SMB123W64GB\n" +
                              "> Using Syroot.NintenTools.Bfres API\n" +
                              "> *.bfres *.obj/*.smd\n");

            ResFile TargetBFRES = new ResFile(args[0]);
            MeshObj test        = new MeshObj();

            test.ReadObj(args[1]);
            test.InjectMesh(TargetBFRES.Models[0], TargetBFRES.ByteOrder);
            TargetBFRES.Models[0].Materials[0].RenderState.PolygonControl.CullBack           = false;
            TargetBFRES.Models[0].Materials[0].RenderState.PolygonControl.CullFront          = false;
            TargetBFRES.Models[0].Materials[0].RenderState.PolygonControl.PolygonModeEnabled = true;
            TargetBFRES.Name = "A_Cool_Mesh";
            Console.WriteLine("Writing {0}", args[0] + ".new.bfres");
            TargetBFRES.Save(args[0] + ".new.bfres");
        }