Jump to content
  • Advertisement

Recommended Posts

Hello! There was a question about performance. I tried to combine (if possible) the shaders into one for rendering in one pass. For example, SSR and Bloom (search for bright areas), blur: DOF and Bloom. But now there is a need to put the output in textures of different sizes. This raises the question: if I split all the shaders (postprocessing) and render the image in several passes (for example, ssr → bloom → blur bloom → blur dof instead of screenspace (ssr and bloom) → blur (bloom and dof)), how much performance can suffer? And in general, merging shaders for rendering in one pass, good practice? I will be grateful for the answer

Share this post

Link to post
Share on other sites

It depends on several things and combining multiple shaders into one can be worse in some cases. In your case, if you want to output into different resolutions, it is likely better to have separate shaders.

Combining multiple shaders into one will be helpful if you are bottlenecked by texture sampling/writing bandwidth. Otherwise, it will increase register usage in the shader and that can affect negatively how the GPU can parallelize the wavefronts (group of threads running a single shader). Because if one shader uses a lot of registers, then it will limit the amount of concurrent shaders that can be started on the GPU at the same time (this is called occupancy). 

To determine your bottleneck, you should use a GPU profiling tool such as Nvidia Nsight, AMD's GPU Perfstudio or Intel's Graphics Performance Analyzer.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!