Пример #1
0
        // ------------------------------------------------------------------------------------------ //
        // Type-Specific (Mesh, Xform, Camera) Exporters.
        // ------------------------------------------------------------------------------------------ //
        void ExportMaterial(Scene scene, Material mat, string usdMaterialPath)
        {
            string shaderPath = usdMaterialPath + "/StandardShader";

            var material = new USD.NET.Unity.MaterialSample();

            material.surface.SetConnectedPath(shaderPath, "outputs:out");

            var shader = new StandardShaderSample();

            shader.id = new pxr.TfToken("Unity.Standard");
            shader.albedo.defaultValue = mat.color;

            scene.Write(usdMaterialPath, material);
            scene.Write(shaderPath, shader);
        }