A Hybrid Renderer V2 batch is using a pass from the shader “Legacy Shaders/Particles/Additive”, which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.
Problem:
I have dozens of shaders from asset store things.
I don’t need it, but I can’t find the offender to delete.
I am not good with shaders or searching for “Legacy Shaders”
If I delete it, it fixes this, right? But how do I find it?
And is the V2 renderer working at all if this error happens?
Changing the shader on the Material that uses it, or changing the Material on the affected the objects should cause this error to not happen.
If the error happens, it might slow down performance for generating the error message, but correctly set up entities should still render, only batches with the erroneous shader are skipped.
It sounds possible that the shader in question is a built-in Unity shader (I am just guessing here based on the shader name), in which case it would be better to change the Material that uses the shader to use some other shader instead.
How do I find it? This has been bugging me for over a week, even crashing my system, reverting it to weird unstable states, wasting days of time.
A Hybrid Renderer V2 batch is using a pass from the shader “Legacy Shaders/Particles/Additive”, which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.
0x00007ff7dc898bdc (Unity) StackWalker::GetCurrentCallstack
0x00007ff7dc89ffd9 (Unity) StackWalker::ShowCallstack
0x00007ff7dd5fcd9c (Unity) GetStacktrace
0x00007ff7de045e83 (Unity) DebugStringToFile
0x00007ff7dc648b55 (Unity) LogRepeatingStringWithFlags
0x00007ff7dc48bec1 (Unity) PrepareScriptableLoopObjectData
0x00007ff7dc48b1e5 (Unity) PrepareScriptableDrawRenderersJob
0x00007ff7dc4b1c2b (Unity) JobQueue::Exec
0x00007ff7dc4b3882 (Unity) JobQueue::Steal
0x00007ff7dc4b1fd0 (Unity) JobQueue::ExecuteJobFromQueue
0x00007ff7dc4b243b (Unity) JobQueue::ProcessJobs
0x00007ff7dc4b426f (Unity) JobQueue::WorkLoop
0x00007ff7dc67f105 (Unity) Thread::RunThreadWrapper
0x00007ff882497034 (KERNEL32) BaseThreadInitThunk
0x00007ff882ba2651 (ntdll) RtlUserThreadStart
Guys, I tried upgrayedding to Hybrid Renderer V2.
Got this message: A Hybrid Renderer V2 batch is using a pass from the shader “Legacy Shaders/Particles/Additive”, which is not SRP batcher compatible. Only SRP batcher compatible passes are supported with the Hybrid Renderer.
Problem:
I have dozens of shaders from asset store things. I don’t need it, but I can’t find the offender to delete. I am not good with shaders or searching for “Legacy Shaders”
If I delete it, it fixes this, right? But how do I find it?
And is the V2 renderer working at all if this error happens?
I’m not sure if there’s an easier way, but one way would be to write a one-off debugging script that checks the shader of every material of every GameObject in your scene, and compares the name against that string.
I’m not sure if there’s an easier way, but one way would be to write a one-off debugging script that checks the shader of every material of every GameObject in your scene, and compares the name against that string.
This is way too difficult. Shaders are known as a difficult hidden arcane art that not everyone knows. HDRP is new technology too amplifying the difficulty. The Unity Editor should have some way of searching this in my project by default. You’re saying there is no way to actually find the prefab with the offending shader with Unity search. That’s so weird… Well it explains why I couldn’t find “legacy” anywhere in unity search. Why couldn’t I find the word “legacy” in my project when I searched via windows? Maybe it’s written in binary??? This is so weird…
The shader “Legacy Shaders/Particles/Additive” could be a Unity built-in shader from the built-in render pipeline, and you have some asset that is using it.
You could try to find the asset in question by running a script like this:
foreach (var o in UnityEngine.Object.FindObjectsOfType(typeof(GameObject)))
{
var go = o as GameObject;
var r = go.GetComponent<MeshRenderer>();
if (r != null)
{
foreach (var m in r.sharedMaterials)
{
var s = m.shader;
var shaderName = s.name;
if (shaderName.Contains("Legacy"))
Debug.Log($"go: {go} m: {m} s: {s}");
}
}
}
I put your code in my editor scripts, had an error:
it was on the line: var s = m.shader;
NullReferenceException: Object reference not set to an instance of an object
GlobalKeyEvents.OnGlobalKeyPressed () (at Assets/Editor/GoodNewsJimCompileSpeeder.cs:85)
UnityEditor.EditorApplication.Internal_CallGlobalEventHandler () (at <1f0be198f5164d2489de92f22c998266>:0)
case KeyCode.F10:
{
foreach (var o in UnityEngine.Object.FindObjectsOfType(typeof(GameObject)))
{
var go = o as GameObject;
var r = go.GetComponent<MeshRenderer>();
if (r != null)
{
foreach (var m in r.sharedMaterials)
{
var s = m.shader;
var shaderName = s.name;
if (shaderName.Contains("Legacy"))
Debug.Log($"go: {go} m: {m} s: {s}");
}
}
}
}
break;
Much obliged, I’m still new to editor scripting, seems powerful tho, maybe fix some issues Unity doesn’t have, like right here, Unity should have the ability to naturally find all resources that contain this.
Okay on execution the script does nothing apparently.