What is ShaderTagId.none used for ?

Hi,

i try this:

            SortingSettings ss = new SortingSettings(renderingData.cameraData.camera);
            DrawingSettings ds = new DrawingSettings(ShaderTagId.none, ss);
            RendererListParams rlp = new RendererListParams(renderingData.cullResults, ds, FilteringSettings.defaultValue);

            RendererList rl = context.CreateRendererList(ref rlp);

to get a RendererList that contains just ANYthing infront of the Camera.

But when i later try to Render the List , it apears Empty (black texture quad in Frame Debugger)

                cmd.SetRenderTarget(_occ);
                cmd.DrawRendererList(rl);

I susspect that i use the ShaderTagId.none wrong.

Yeah shaderTagId none would in drawing settings probably results to draw nothing. Shader Tags are set in most shader as “transparent” or “opaque” etc. etc.
So if you want to draw anything you certainly can not specify None ^^

Edit: sorry what I said is probably not correct. Shader Tags specify stuff like default renderqueue etc. and if the shader is treated as transparent or opaque that is true. But the answer by elliotB below is probably better suited to the topic of how ShaderTagId is handled in regards to SRP. Plus here ShaderTagId refers to the value which is set as LightMode Tag inside the shader file.

The documentation on this command is a bit unhelpful, so I’ll give my understanding of it. A source of confusion is that a shader tag can mean many different things in different circumstances. For example, it could mean the value of a shader pass, a render type, etc.

In the way you have specified it, the should refer to the pass to draw. e.g.:

            DrawingSettings ds = new DrawingSettings(new ShaderTagId("UNIVERSALFORWARD"), ss);
            RendererListParams rlp = new RendererListParams(renderingData.cullResults, ds, FilteringSettings.defaultValue);
            RendererList rl = context.CreateRendererList(ref rlp);

You can also specify to change the render state according to the RenderType, for example:

                    // Allow only shaders matching "RenderType" = "MyRenderType" to pass the depth test
                    var stateBlocks = new NativeArray<RenderStateBlock>(2, Allocator.Temp);
                    stateBlocks[0] = new RenderStateBlock(RenderStateMask.Nothing);
                    stateBlocks[1] = new RenderStateBlock(RenderStateMask.Everything)
                    {
                        depthState = new DepthState(false, CompareFunction.Never),
                    };

                    // Create the parameters that tell Unity when to override the render state
                    ShaderTagId renderType = new ShaderTagId("MyRenderType");
                    var renderTypes = new NativeArray<ShaderTagId>(2, Allocator.Temp);
                    renderTypes[0] = renderType;
                    renderTypes[1] = new ShaderTagId(); //default -> 'all others'.
                    context.DrawRenderers(renderingData.cullResults, ref drawingSettings, ref filteringSettings, renderTypes, stateBlocks);
                    stateBlocks.Dispose();
                    renderTypes.Dispose();

In this case the empty ShaderTagId is used to mean ‘otherwise’. Note that these shaders will still be drawn, but they will be rejected on the depth test.