Correct Image Pipeline

  • vfxninjaeditor
  • Topic Author
More
8 years 8 months ago - 8 years 8 months ago #1 by vfxninjaeditor Correct Image Pipeline was created by vfxninjaeditor
Hey Lucifer (and other shader developers),

I am a VFX artist and compositor. I also work in photography and film. Reshade is absolutely fantastic and one of the best things to happen for PC gamers in good while.

Something I have been thinking about since the mediator got released is correct image pipeline. When doing visual effects one of the things that needs to be understood is how a camera works and what comes first. I know we are dealing with a video game shader suite, but I think the same techniques apply here and will improve the look of things in general.

I'll start by quickly going over the correct pipeline in video or film. The very first thing that happens is light hitting the lens of the camera. No light, no image. Light includes everything you can see and depth of field. The next thing is lens artifacts. These include natural lens vignetting, lens filter flares, lens distortion, lens blur caused by low quality glass (field curvature lens blur), lens flares, airy disk glow, astigmatism and chromatic aberration. The last thing, if you are shooting on film, is film grain. Other image alteration like post vignetting and color correction come very last. Adhering to this order results in more correct composites and better looking final images.

The current framework is all over the place with effect order. The mediator allows you to re-position some effects but sometimes you can only move whole suites at a time which makes sorting this as a user almost impossible.

As an example, here is a list of all current framework effects in the correct order (with explanations if needed):

1. Light (everything that pre-exists in the scene):
Reflective Bump Mapping
Ambient Occlusion
Godrays (could be moved after DoF, it all depends on if you want blurred or sharp godrays. Behind DoF they behave more like their real world counterpart since they are physically in the scene and would therefore get blurred)
Depth of Field/Tilt Shift
Bloom Shaders
Ambient Light
Heat Haze
Motion Focus
Motion Blur
Deband

2. Lens:
Lens Dirt
Vignette (Can be moved to post vignetting. Depends on the user)
Lens Distortion Shaders
Lens Flare Shaders
Chromatic Aberration Shaders

3. Film:
Sharpening Shaders
Film Grain Shaders

4. Color Correction and other Post Edits:
TuningPalette (Should come first because a LUT would be your primary tool for color correction if you are using it. You don't want other color shaders to come before it)
All other SweetFX Color Related Shaders
All CustomFX Color Related Shaders
Image Conversion Shaders (Emboss, ASCII, Cartoon, Explosion, Advanced CRT, Pixelart CRT, Cel, Paint)
Post Vignette
Anti Aliasing Shaders
Dither
GR8MMFILM
Border
Splitscreen

For obvious reasons I left out the BasicFX, and I am not 100% sure where Gauss would go as it contains blurring, sharpening and bloom all at once. Best to leave that up to the user.

Sorry for the really long post. I also realize that setting this up might be difficult. It would be really awesome to have everything in the correct and logical order though. Thank you for your time!
Last edit: 8 years 8 months ago by vfxninjaeditor.
The following user(s) said Thank You: Wicked Sick, BillyAlt, jas01, WLHM15

Please Log in or Create an account to join the conversation.

  • Constantine PC
More
8 years 8 months ago #2 by Constantine PC Replied by Constantine PC on topic Correct Image Pipeline
I actually found putting Deband right before the general shaders was the best for me. Some shaders cause banding and if you have them after deband, they don't get debanded. Notably AO and DOF. I actually reported these a while back in the Framework forum thinking they just broke deband, but JPulowski suggested I move Deband after AO and DOF in the effect ordering and it fixed the issue.

Please Log in or Create an account to join the conversation.

  • vfxninjaeditor
  • Topic Author
More
8 years 8 months ago #3 by vfxninjaeditor Replied by vfxninjaeditor on topic Correct Image Pipeline
Good note, I'll move it to the end of the 1st list.

Please Log in or Create an account to join the conversation.

  • vfxninjaeditor
  • Topic Author
More
8 years 8 months ago #4 by vfxninjaeditor Replied by vfxninjaeditor on topic Correct Image Pipeline

Constantine PC wrote: I actually found putting Deband right before the general shaders was the best for me. Some shaders cause banding and if you have them after deband, they don't get debanded. Notably AO and DOF. I actually reported these a while back in the Framework forum thinking they just broke deband, but JPulowski suggested I move Deband after AO and DOF in the effect ordering and it fixed the issue.


Side note, do you have some recommended settings for deband? The last couple times I tried using it a stopped because it was frustrating me. It was really messing up the quality of the image.

Please Log in or Create an account to join the conversation.

  • Ganossa
More
8 years 8 months ago #5 by Ganossa Replied by Ganossa on topic Correct Image Pipeline
Please note that currently the AO and DoF shader overwrite any prior shader output. Therefore they have to be at the beginning.

I explained before why certain shader are grouped together. There is no suite group or rule for that but it depends on the individual techniques.

A shader is part of a technique and a technique is the group of one or more shader in the pipeline. While you could order a shader within its own technique, global ordering can only be done between techniques.

Why not have only one technique and order shader in it? Techniques are currently the structures that are allowed to be toggled, timed or similar. We need individual techniques to be able to toggle individual effects.

Why not having only one shader for each technique and therefore single shader groups? First of all each technique comes with a bit of overhead. Therefore, we have for example some color correction shader in sweetfx grouped together on purpose to minimize this overhead. Secondly, a shader developer that creates a complicated effects with several shader needs to specify his own fixed pipeline of shader within the technique of his effect to ensure it does not break. Some shader are dependent or should be in a certain fixed order by design.

All this is no limitation of ReShade, the Framework or the mediator but a decision by us shader developer to ensure proper functionality, results and performance :)
The following user(s) said Thank You: Constantine PC

Please Log in or Create an account to join the conversation.

  • BillyAlt
More
8 years 8 months ago #6 by BillyAlt Replied by BillyAlt on topic Correct Image Pipeline

vfxninjaeditor wrote:

Constantine PC wrote: I actually found putting Deband right before the general shaders was the best for me. Some shaders cause banding and if you have them after deband, they don't get debanded. Notably AO and DOF. I actually reported these a while back in the Framework forum thinking they just broke deband, but JPulowski suggested I move Deband after AO and DOF in the effect ordering and it fixed the issue.


Side note, do you have some recommended settings for deband? The last couple times I tried using it a stopped because it was frustrating me. It was really messing up the quality of the image.


Pretty much needs to be done on a per-game basis. Modern games you will want to go light on it as some have *very* detailed textures. Games like Witcher 3, Call of Duty: Advanced Warfare, Dying Light and others have very detailed and alias-prone textures. Banding is less noticeable in such high details as well.

Older games will benefit from stronger settings as they typically have lower detailed textures and much more noticeable banding, especially before HDRR became de facto.

Also, it is very important that debanding be placed last, as you said, even for some of ReShade's own shaders. Gaussian Anamorphic Flare and Ambient Light benefit greatly from Debanding. Ambient Occlusion can also benefit. You can get away from using less pretty setting but higher performance settings if you deband them afterwards.

I'm not a VFX artist by profession, but it's something I like to study in my spare time. I concur with most of vfxninjaeditor's suggestions. I will disagree with his Post-Antialiasing suggestions, however. You could put it anywhere, really, but I would recommend putting it before most everything else, especially Chromatic Aberration. Rendering Post-AA so late in the pipeline can make it very inaccurate and make the image much blurrier than it needs to be. One could argue it would best done after color-correction, especially for detecting chroma, but I still recommend doing it as early as possible. Pretty much all aliasing occurs before the ReShade shaders have their way with the frame.

A note, for less knowledgeable users: Some effects, like Ambient Occlusion, will look completely awful if done much later in the pipeline. Rendering Depth of Field before Ambient Occlusion would completely ruin the image, for instance.

Please Log in or Create an account to join the conversation.

  • Ioxa
More
8 years 8 months ago #7 by Ioxa Replied by Ioxa on topic Correct Image Pipeline

vfxninjaeditor wrote:

Constantine PC wrote: I actually found putting Deband right before the general shaders was the best for me. Some shaders cause banding and if you have them after deband, they don't get debanded. Notably AO and DOF. I actually reported these a while back in the Framework forum thinking they just broke deband, but JPulowski suggested I move Deband after AO and DOF in the effect ordering and it fixed the issue.


Side note, do you have some recommended settings for deband? The last couple times I tried using it a stopped because it was frustrating me. It was really messing up the quality of the image.


I had this issues with Dead Space 2. The game has so much banding that the deband shader turned everything into a blurry mess, I came up with a pretty good way of getting some of the detail back though if you want to try it.

Open Deband.h and add these lines around line #75 (just before the additional dithering).
float3 luma = dot(col0,float3(0.2126, 0.7152, 0.0722));
float3 chroma = accu.rgb - dot(accu.rgb,float3(0.2126, 0.7152, 0.0722));
accu.rgb = lerp(accu.rgb,luma+chroma,DetailStrength);
Then open CustomFX.cfg and add this line with the rest of the Deband settings.
#define DetailStrength 0.70 //[0.00:1.00] //-
Doing this will put back some of the banding but keeping it between 0.50 and 0.70 seems to be the best balance.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • vfxninjaeditor
  • Topic Author
More
6 years 9 months ago #8 by vfxninjaeditor Replied by vfxninjaeditor on topic Correct Image Pipeline
I am assuming that this can now mostly be achieved with Reshade 3.0? The whole system seems to be restructured and the previous limitations that were described are no longer an issue. If anyone knows otherwise, please correct me.

Please Log in or Create an account to join the conversation.

  • FierySwordswoman
More
6 years 9 months ago #9 by FierySwordswoman Replied by FierySwordswoman on topic Correct Image Pipeline

vfxninjaeditor wrote: I am assuming that this can now mostly be achieved with Reshade 3.0?

Yes. You can even order sub-effects such as the different types of DOF outside of the main shader.
So you could have Matso DOF > LUT.fx > Advanced DOF in that order.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.