Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Reflect Samples problem

Discussion in 'Unity Reflect' started by ChangSoft, Jun 6, 2021.

  1. ChangSoft

    ChangSoft

    Joined:
    Mar 22, 2021
    Posts:
    6
    Hello,

    When I start the samples from Reflect pipeline samples, I get an exception of null reference .
    The shader is null.
    How can I set a right shader ?


    public class SyncMaterialImporter : RuntimeImporter<SyncMaterial, Material>
    {
    public override Material CreateNew(SyncMaterial syncMaterial, object settings = null)
    {
    var shader = ReflectMaterialManager.GetShader(syncMaterial);

    var material = new Material(shader);
    material.enableInstancing = true;
    return material;
    }
     
  2. ChangSoft

    ChangSoft

    Joined:
    Mar 22, 2021
    Posts:
    6
    I found that unity reflect samples are working with URP settings. So start the project with URP template, then it will work.
     
    Junho-Jeon likes this.