Skip to content

Problem using GPU Resident Drawer Instanced Drawing #567

@MNHNAMeaning

Description

@MNHNAMeaning

Console Error Message:
A BatchDrawCommand is using a pass from the shader "Toon" that is not SRP Batcher compatible. Reason: "UnityPerMaterial CBuffer inconsistent size inside a SubShader" (Universal2D)
This is not supported when rendering with a BatchRendererGroup (or Entities Graphics). MaterialID: 4 ("Yu_Face2"), MeshID: 1 ("pasted__yuko_head002"), BatchID: 3.

This results in pink materials

Steps to reproduce the behavior:

  1. URP
  2. Set GPUResidentDrawerMode to Instanced Drawing
  3. Warning appears asking to set Batch Renderer Group Variants to "Keep All"
  4. Set Batch Renderer Group Variants to "Keep All"
  5. Materials appear pink

Expected behavior
Properly rendered materials are expected, no errors in the console( and i also think that error description points the wrong way claiming that the shader is not SRP Batcher compatible, because just enabling SRP Batcher doesnt break anything)

Screenshots

Image

Desktop (please complete the following information):

  • OS: [Windows 11]
  • Browser [Firefox]
  • Version [144.0.2]

Additional context
I also noticed that the problem doesnt occur when using skinned mesh renderer(my guess).
Originally I just imported animated model using Mixamo, then i discovered this shader and decided to give it a try, imported it and then went through the settings top to bottom, checking if they work as expected on the model. They were until the outline, because it didnt appear on the screen no matter the settings(later i checked the Depth Priming mode settings like the Known Issues suggests, it solved the outline being not visible), then i checked the wireframe mode(i dont remember why i did that), and so i noticed giant spheres around the character, instantly figured out that the issue is the scaling of the model, and because i dont know how to fix that i just imported the original model i made with correct scalings and rotation. It was pink. I did some searching, obviosly didnt come up with a proper solution, therefore i am writing this issue

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions