Stencil test performance question

Node-based Shader Editor

Stencil test performance question

Postby mossman » Sat Jan 05, 2019 8:37 pm

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
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Stencil test performance question

Postby Amplify_Borba » Tue Jan 08, 2019 10:08 am

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.
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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Stencil test performance question

Postby mossman » Thu Jan 10, 2019 6:46 pm

Ok Many thanks is very useful.
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Stencil test performance question

Postby Amplify_Borba » Fri Jan 11, 2019 11:37 am

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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 8 guests