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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question URP shader warning: Material property is found in another cbuffer than "UnityPerMaterial"

Discussion in 'Universal Render Pipeline' started by SeriouslyNot, Jun 30, 2020.

  1. SeriouslyNot

    SeriouslyNot

    Joined:
    Nov 24, 2017
    Posts:
    121
    I wanted to create a custom simple URP shader (Unlit Transparent shader) for my 2D game and enable GPU-Instancing on that shader, so i followed the docs here. But Unity is giving this weird warning:




    I saw on Unity blogs that this is an SRP batcher issue,

    1- How can i fix this warning and still have GPU Instancing working on this shader?

    2- Can i have GPU Instancing and SRP Batcher together?
     
  2. salvolannister

    salvolannister

    Joined:
    Jan 3, 2019
    Posts:
    50
    Did u manage to solve the problem?
     
    filip-mixedworld and Sararaposa like this.
  3. Sararaposa

    Sararaposa

    Joined:
    Dec 6, 2021
    Posts:
    3
    Hi! Im getting the exact same problem. I have no idea how to fix this. Any help would be very welcome
     
  4. Sararaposa

    Sararaposa

    Joined:
    Dec 6, 2021
    Posts:
    3
    Do you know how to solve it? *-*
     
  5. Wasserwecken

    Wasserwecken

    Joined:
    Oct 9, 2017
    Posts:
    6
    Xczzxcv and aprilfooleowyn like this.
  6. clean_target

    clean_target

    Joined:
    Apr 29, 2023
    Posts:
    1
    upload_2023-5-1_15-50-12.png
    when i remove the code in red frame, the warning was disappear and srp batcher was compatible, but my custom shader must have properties region, I dont know how to solve that.
     
  7. diegojesusalmeida

    diegojesusalmeida

    Joined:
    Feb 27, 2020
    Posts:
    1
    To solve this I added all floats of the shader inside a CBUFFER_START
    Code (HLSL):
    1.    Pass
    2.         {
    3.             Tags { "LightMode"="UniversalForward" }
    4.            
    5.             HLSLPROGRAM
    6.             #pragma vertex vert
    7.             #pragma fragment frag
    8.  
    9.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
    10.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
    11.                  
    12.             sampler2D _MainTex;
    13.             sampler2D _tintMask;
    14.            
    15.             CBUFFER_START(UnityPerMaterial)
    16.             float4 _MainTex_ST;
    17.             float4 _tintMask_ST;
    18.             float _specularSize;
    19.             CBUFFER_END