docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Access VPB materials

    For VPB materials, use Pixyz custom materials. To create custom shaders, use material properties.

    Before importing assets with VPB materials, you must perform these tasks:

    1. Turn on custom material setup to allow information mapping between imported materials and Unity materials.
    2. Create a custom material setup to map this information.
    3. Add this setup to the default import parameters.

    The Pixyz.ImportSDK.MaterialConversions class converts materials. The ConvertCustomMaterial function converts custom materials.

    Turn on custom material setup

    Follow these steps:

    1. From the API, turn on the import of realistic materials:

      Plugin4UnityProduct.API.Core.SetModuleProperty("IO", "ImportRealisticMaterials", "True")
      
    2. Modify the Menu.cs file that is located in the folder packages/com.unity.pixyz.plug4unity/Editor/UI:

      1. Add the Conversion namespace:

        using UnityEngine.PixyzCommons.Conversion;
        
      2. Remove the comment characters (//) for the CreateCustomMaterialSetupAsset function:

        //[MenuItem("Pixyz/Create Custom Material Setup", false, 9)]
        
        //[MenuItem("Assets/Create/Pixyz/Custom Material Setup", priority = 1)]
        
        //private static void CreateCustomMaterialSetupAsset()
        
        //{
        
        //    EditorExtensions.CreateAsset<CustomMaterialSetup>("CustomMaterialSetup", true);
        
        //}
        

    This example shows the first lines of the file after modification:

    using System.Text;
    
    using UnityEditor.PixyzCommons.Extensions;
    
    using UnityEngine;
    
    using UnityEngine.PixyzCommons.Conversion;
    
    using UnityEngine.PixyzCommons.Licensing;
    
    namespace UnityEditor.PixyzCommons.UI
    
    {
    
        internal static class Menus
    
        {
    
            [MenuItem("Pixyz/Create Custom Material Setup", false, 9)]
    
            [MenuItem("Assets/Create/Pixyz/Custom Material Setup", priority = 1)]
    
            private static void CreateCustomMaterialSetupAsset()
    
            {
    
                EditorExtensions.CreateAsset<CustomMaterialSetup>("CustomMaterialSetup", true);
    
            }
    

    Create a custom material setup

    Before importing custom materials, you must map information between imported materials and Unity materials:

    1. From the Pixyz menu, choose Create Custom Material Setup.
    2. Map the material names:
      1. On the Inspector pane, select the Plus sign (+) in the Custom Material Setup section.
      2. Enter the name of the imported material, for example UMetallicPaintMaterial, then select Validate.
      3. Enter the name of the Unity material, for example Shader Graphs/CarPaint.
    3. Map the property names:
      1. Expand the Properties section and select Add property binding.
      2. Enter the property name of the imported material, for example flakeColor, then select Validate.
      3. In the Keyword field, enter the property name of the Unity material, for example ColorCF7B3627.

    Select a custom material setup for import

    To use a custom material setup for import, follow these steps:

    1. In your project assets, expand Pixyz > Editor and select Default Import Settings.
    2. Switch to the debug mode. Read more about Inspector options in the Unity manual.
    3. In the list of import parameters, add a custom material setup in the Custom Material Setup field.

    This illustration shows an Aviera model that has been imported using Pixyz Plugin for Unity:

    The car model has very precise details and light is cast in a realistic way.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)