How to use the "shader" keyword/filter in assets search window?

Hello,

I’m looking for a way to find all materials using a specific shader. For that, I supposed I could use the “shader:” keyword/filter inside an index when doing a search with Unity “Seach” tool.

I created an index with only materials inside, the index report to have the “shader:” filter, but my attempts to use it all failed and I cannot find any discussion in the forum or in the documentation. All others filters are well-referenced in the manual here, but the “shader” keyword is missing

My attempts so far (based on other filters):

  • shader:SHADER_NAME

  • shader:ShaderCategory/SHADER_NAME

  • shader:“SHADER_NAME”

  • shader:“Shader Category/SHADER_NAME”

I’m out of idea right now. Hope someones can help me find a way to achieve my search, thank you!

Haha, I found it!

The correct syntax is…

  • shader:“Assets/Full/Path/To/Shader/File.shader”

(replace the extension with “.shadergraph” if it’s a shadergraph)

So it’s working, but a bit cumbersome to provide the full path, I wish we could just use the name of the name

3 Likes

Thank you, this is a life saver!

Using the visual QueryBuilder available in 22.3 (and forward) you can achieve this results without remebering the syntax of the shader filter:

search_shader_reference

1 Like