Search Unity

Question Material property is found in another cbuffer....

Discussion in 'Shaders' started by Zimaell, Feb 27, 2023.

  1. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    409
    I wrote a baked animation shader (URP), a lot of it was taken from the lit shader, it works completely, it works and save batching, but at the same time I get a warning in the shader

    Material property is found in another cbuffer than unitypermaterial (_AnimMap_TexelSize)

    I have the following lines in my shader
    Code (CSharp):
    1. sampler2D _AnimMap;
    2. float4 _AnimMap_TexelSize;
    3. ............
    4. Varyings LitPassVertex(Attributes input, uint vid : SV_VertexID){
    5.     Varyings output = (Varyings)0;
    6.     UNITY_SETUP_INSTANCE_ID(input);
    7.     UNITY_TRANSFER_INSTANCE_ID(input, output);
    8.     UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
    9.     float x = (vid + 0.5) * _AnimMap_TexelSize.x;
    10. ...............
    I do not understand what is required of me, how to get rid of this warning?

    (but shader works, and the batches are saved...)

    CBUFFER_START(UnityPerMaterial) I can't apply, there will be an error

    Duplicate constant buffer declaration: UnityPerMaterial


     

    Attached Files:

    ThunderGuppy likes this.