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. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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.