Skip to main content
added 4 characters in body
Source Link

Usually each post processing effect has it own pass unless the effects are "organically" coupled and/or are simple. For example, to simulate an old film camera, you could put the grayscale, sepia, noise, scratch and vignetting effects all inside the same shader, since each effect is a simple part of the goal effect. On the other hand, some other effects have a post or pre blur pass, because of the more complex computations that blurring requires.

It is important to note that the more complex the shader less flexible it is. So in a code maintainability perspective, assembling a shader as a weird set of effects is bad. In addition, the parallelism of a shader can be damaged if it uses a lot of registers (the case of huge shaders). This can lead to bad performance in some cases. If mixing the effects also leads to more divergence in conditional branches the performance penalty iscan be even worse.

Usually each post processing effect has it own pass unless the effects are "organically" coupled and/or are simple. For example, to simulate an old film camera, you could put the grayscale, sepia, noise, scratch and vignetting effects all inside the same shader, since each effect is a simple part of the goal effect. On the other hand, some other effects have a post or pre blur pass, because of the more complex computations that blurring requires.

It is important to note that the more complex the shader less flexible it is. So in a code maintainability perspective, assembling a shader as a weird set of effects is bad. In addition, the parallelism of a shader can be damaged if it uses a lot of registers (the case of huge shaders). This can lead to bad performance in some cases. If mixing the effects also leads to more divergence in conditional branches the performance penalty is even worse.

Usually each post processing effect has it own pass unless the effects are "organically" coupled and/or are simple. For example, to simulate an old film camera, you could put the grayscale, sepia, noise, scratch and vignetting effects all inside the same shader, since each effect is a simple part of the goal effect. On the other hand, some other effects have a post or pre blur pass, because of the more complex computations that blurring requires.

It is important to note that the more complex the shader less flexible it is. So in a code maintainability perspective, assembling a shader as a weird set of effects is bad. In addition, the parallelism of a shader can be damaged if it uses a lot of registers (the case of huge shaders). This can lead to bad performance in some cases. If mixing the effects also leads to more divergence in conditional branches the performance penalty can be even worse.

Source Link

Usually each post processing effect has it own pass unless the effects are "organically" coupled and/or are simple. For example, to simulate an old film camera, you could put the grayscale, sepia, noise, scratch and vignetting effects all inside the same shader, since each effect is a simple part of the goal effect. On the other hand, some other effects have a post or pre blur pass, because of the more complex computations that blurring requires.

It is important to note that the more complex the shader less flexible it is. So in a code maintainability perspective, assembling a shader as a weird set of effects is bad. In addition, the parallelism of a shader can be damaged if it uses a lot of registers (the case of huge shaders). This can lead to bad performance in some cases. If mixing the effects also leads to more divergence in conditional branches the performance penalty is even worse.