Hello,
I want to know if a shader without a stencil test consumes less than a shader with a stencil test with default values (
Ref 0, ReadMask 255, WriteMask 255, Comp always, Pass keep, Fail keep, ZFail keep) or is the same.
Thanks
Stencil test performance question
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Stencil test performance question
Hey there, performance will always depend on the shader's complexity, features used and the target device, so the most accurate answer you can get is by testing the shader on your target hardware and measure what happens.
You can use the RenderDoc and GPUOpen tools to benchmark your shaders, or even Unity's frame debugger, as it can be hard to predict how certain operations would perform under different shader types.
Specifically regarding Stencil, in some cases you can gain performance by discarding pixels as they won't have any further operations performed on them, however, this might not always be the case.
You can use the RenderDoc and GPUOpen tools to benchmark your shaders, or even Unity's frame debugger, as it can be hard to predict how certain operations would perform under different shader types.
Specifically regarding Stencil, in some cases you can gain performance by discarding pixels as they won't have any further operations performed on them, however, this might not always be the case.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Stencil test performance question
Ok Many thanks is very useful.
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Stencil test performance question
No problem, always happy to help!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!