Color Filter
- Ioxa
- Topic Author
I put together a test shader with an option to adjust colors in the highs, mids, and lows of the filter if you want to try it out and see if you can get the look you want. I reduced it to only one filter so you may not be able to achieve the same look you have now but if the adjustments work well I can add more filters later.
I also decided to accept DeMondo's challenge and I put together a chromatic aberration shader. Its a little rough around the edges but it seems to be working well. I decided to do something a little different than the other CA shaders and I added an option to select the CA type. You can choose between red/cyan, blue/yellow, green/magenta, or the usual red/yellow/cyan/blue. I'm not a big fan of CA but I think the red/cyan is pretty nice looking. So if anyone wants to try it out and let me know if I'm on the right track I'd appreciate it!
Download Color Filter Test w/ Chromatic Aberration
Install Instructions
1. Copy the ReShade folder to the folder that ReShade was installed to. Merge it with the existing folder.
2. Open the ReShade folder and find EffectOrdering.cfg
3. Decide where in the effect order you would like it to run and add the following line.
#include EFFECT(ColorFilter, ColorFilter)
It should look something like this.
.
| :: Effect Ordering :: |
'
*/
#include EFFECT(CustomFX, Deband)
#include EFFECT(McFX, SSAO)
#include EFFECT(McFX, DOF)
#include EFFECT(CustomFX, TiltShift)
#include EFFECT(GemFX, AdvMotionBlur)
#include EFFECT(GemFX, MotionBlur)
#include EFFECT(GemFX, MotionFocus)
#include EFFECT(GemFX, Bloom)
#include EFFECT(SweetFX, Shared)
#include EFFECT(GemFX, AmbientLight)
#include EFFECT(McFX, HeatHaze)
#include EFFECT(CustomFX, TuningPalette)
#include EFFECT(SweetFX, Ascii)
#include EFFECT(SweetFX, Cartoon)
#include EFFECT(CustomFX, AdaptiveSharpen)
#include EFFECT(SweetFX, LumaSharpen)
#include EFFECT(SweetFX, SMAAWrap)
#include EFFECT(SweetFX, Explosion)
#include EFFECT(SweetFX, FXAAWrap)
#include EFFECT(SweetFX, Bloom)
#include EFFECT(SweetFX, HDR)
#include EFFECT(SweetFX, CA)
#include EFFECT(SweetFX, AdvancedCRT)
#include EFFECT(SweetFX, PixelartCRT)
#include EFFECT(SweetFX, LensDistortion)
#include EFFECT(CustomFX, ColorCorrection)
#include EFFECT(CustomFX, Cel)
#include EFFECT(ColorFilter, ColorFilter)
#include EFFECT(CustomFX, Gaussian)
#include EFFECT(CustomFX, Paint)
#include EFFECT(CustomFX, Custom)
#include EFFECT(McFX, FishEyeCA)
#include EFFECT(CustomFX, Gr8mmFilm)
#include EFFECT(Common, UIMask)
#include EFFECT(Common, Border)
#include EFFECT(Common, SplitScreen)
#include EFFECT(Common, DisplayDepth)
#include EFFECT(SweetFX, Transition)
#include EFFECT(Common, ToggleMessage)
4. Open the Framework Mediator and find the ColorFilter tab to adjust the settings.
Please Log in or Create an account to join the conversation.
- DeMondo
CA is always tricky & can "break" the visuals, but when its done in a good way, it really enhances the visuals, you nailed it!
Please Log in or Create an account to join the conversation.
Ioxa wrote: I'll have to look into that DOF issue.
I put together a test shader with an option to adjust colors in the highs, mids, and lows of the filter if you want to try it out and see if you can get the look you want. I reduced it to only one filter so you may not be able to achieve the same look you have now but if the adjustments work well I can add more filters later.
I also decided to accept DeMondo's challenge and I put together a chromatic aberration shader. Its a little rough around the edges but it seems to be working well. I decided to do something a little different than the other CA shaders and I added an option to select the CA type. You can choose between red/cyan, blue/yellow, green/magenta, or the usual red/yellow/cyan/blue. I'm not a big fan of CA but I think the red/cyan is pretty nice looking. So if anyone wants to try it out and let me know if I'm on the right track I'd appreciate it!
Download Color Filter Test w/ Chromatic Aberration
Install Instructions
1. Copy the ReShade folder to the folder that ReShade was installed to. Merge it with the existing folder.
2. Open the ReShade folder and find EffectOrdering.cfg
3. Decide where in the effect order you would like it to run and add the following line.
#include EFFECT(ColorFilter, ColorFilter)
It should look something like this.Warning: Spoiler!/*
.
| :: Effect Ordering :: |
'
*/
#include EFFECT(CustomFX, Deband)
#include EFFECT(McFX, SSAO)
#include EFFECT(McFX, DOF)
#include EFFECT(CustomFX, TiltShift)
#include EFFECT(GemFX, AdvMotionBlur)
#include EFFECT(GemFX, MotionBlur)
#include EFFECT(GemFX, MotionFocus)
#include EFFECT(GemFX, Bloom)
#include EFFECT(SweetFX, Shared)
#include EFFECT(GemFX, AmbientLight)
#include EFFECT(McFX, HeatHaze)
#include EFFECT(CustomFX, TuningPalette)
#include EFFECT(SweetFX, Ascii)
#include EFFECT(SweetFX, Cartoon)
#include EFFECT(CustomFX, AdaptiveSharpen)
#include EFFECT(SweetFX, LumaSharpen)
#include EFFECT(SweetFX, SMAAWrap)
#include EFFECT(SweetFX, Explosion)
#include EFFECT(SweetFX, FXAAWrap)
#include EFFECT(SweetFX, Bloom)
#include EFFECT(SweetFX, HDR)
#include EFFECT(SweetFX, CA)
#include EFFECT(SweetFX, AdvancedCRT)
#include EFFECT(SweetFX, PixelartCRT)
#include EFFECT(SweetFX, LensDistortion)
#include EFFECT(CustomFX, ColorCorrection)
#include EFFECT(CustomFX, Cel)
#include EFFECT(ColorFilter, ColorFilter)
#include EFFECT(CustomFX, Gaussian)
#include EFFECT(CustomFX, Paint)
#include EFFECT(CustomFX, Custom)
#include EFFECT(McFX, FishEyeCA)
#include EFFECT(CustomFX, Gr8mmFilm)
#include EFFECT(Common, UIMask)
#include EFFECT(Common, Border)
#include EFFECT(Common, SplitScreen)
#include EFFECT(Common, DisplayDepth)
#include EFFECT(SweetFX, Transition)
#include EFFECT(Common, ToggleMessage)
4. Open the Framework Mediator and find the ColorFilter tab to adjust the settings.
Any way you can do a version with CA only?
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Nice! Good to hear! I've never liked CA because its too distracting but after doing some image searches I found some examples that looked pretty good so I just tried to replicate what I saw. And to answer your question from the other thread, for the smoothing I use multiple samples but stagger the offsets to give it a blurred look. And for the lens distortion with smoothing I use an already blurred image for the samples to try and make it look like the light is being stretched at the edges, still adjusting that stuff though.DeMondo wrote: Thanks Ioxa, your CA shader gives very good results!!!
CA is always tricky & can "break" the visuals, but when its done in a good way, it really enhances the visuals, you nailed it!
@ matsilagi
When its done, or at least closer to done, I may make it a separate shader. Or I may combine all my shaders into one package so I can avoid doing some things multiple times and hopefully improve performance.
Please Log in or Create an account to join the conversation.
- padolamap
Please Log in or Create an account to join the conversation.
- vfxninjaeditor
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
vfxninjaeditor wrote: I can't seem to get this working with the newest release by following the provided instructions. Anyone have a similar issue? I really want to try out the CA in this one.
It's working fine for me. In the new release EffectOrdering.cfg has been renamed to Pipeline.cfg, you will have to type the #include line in there instead.
And don't get your hopes up on the CA shader, its a very rough version of what I have in mind for the final version, I just included it with the ColorFilter shader because I wanted to get some feedback. But if you get it working let me know what you think! And if you have any ideas for improving it let me know!
Please Log in or Create an account to join the conversation.
- DeMondo
I renamed the folder ColorFilterTest to --> ColorFilter
and renamed ColorFilter_settings.cfg to ColorFilter.cfg
edit ColorFilter.h: #include "ReShade/ColorFilter_settings.cfg" to --> #include "ReShade/ColorFilter.cfg"
and copy ColorFilter.cfg to ...\ReShade Framework 1.0.0\ReShade
-
-
@Ioxa: thank you for your explanation, I really like the results I get with your CA shader.
I tried some things & changed: #define CA_Smoothing 4 //[0:4] to --> #define CA_Smoothing 12 //[0:16] for extra fading out the CA.
If it's ok to make a suggestion : perhaps to make the CA glow around the CA core.
Please Log in or Create an account to join the conversation.
- kingeric1992
about CA, I wonder if something like this is possible in reshade:
P0: Gaussian H on backbuffer with blur radius scale depending on current texcoord
P1: Gaussian V on previous pass with same radius function (not proper form for separable gaussian, but it still do the trick)
P2: have multiple distorted sample on different distortion level, each filtered with different chromatic/ spectrum color and blend them together.(P1, P2 can be combined)
or do the distortion first, then blur + postprocess
It is just a extension to conventional CA shader, including additional blur to soften the edge for blending(process similar to fake tilt-shift where blur radius is calculated from distance to tilt-shift axis, here uses distance to screen center), multiple layers to simulate dispersion instead of simple RGB.
(spectrum color can be pre deffined values, or use 1d sampler)
and to do this on deferred rendering, either add a small blur on the resource when final blend on blending or pass the blur radius all the way down and use smoothstep to tell shader when to on blend to CA texture when blur radius is larger then current res.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
I'm sending a copy of the original image to a down sampled texture, then sending that to the blur passes, this give me 3 different distortion levels (well 2 because 1 isn't blurred).
Then I basically use a modified version of the vignette shader from SweetFX for the texcoords and stagger multiple samples with increasing distance from the center.
Then I use a mask, that is also basically the vignette shader, and blend the center textures with the outer textures using smoothstep.
This is what it looks like now. These are with the settings on max to make it easier to see.
And this is how it looks without the CA.
Is this close to what you're thinking? Or do you think using something like tilt-shift would give a better result?
@DeMondo Thats odd you guys were having problems with it, it was working fine for me. Either way I'm gonna have to update this stuff to fit the new mediator format.
I might be able to do what you're asking... I have a couple ideas that may work. If you can find an example it would be a huge help. And keep the suggestions coming!
Please Log in or Create an account to join the conversation.
- kingeric1992
P0. distorted sample on multiple level with chromatic/ specturm filter on different layers. save to buffer
P1. read buffer, 1d radial blur on distortion scale (no need for 2d after all, we are only operate 1d pixel displacement here), then continue to other CC process.
(don't know how to fine tune PS's radial blur, so the blur scale in the demo isn't ideal)
and before radial blur
and details
//cant get this to post... too many links
i.imgur.com/BT4fu4l.jpg
i.imgur.com/ZJGTgL1.jpg
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Doing a radial blur like in your examples would probably make the effect brighter but I want to move the red and blue channels in opposite directions and leave the green channel centered. My hope was that the final image wouldn't look too blurry or distorted but I don't know if there is any way to avoid that. Maybe I could limit the blurring to only bright pixels, that might solve another problem I'm running into.
As the blur gets wider the lights get dimmer, which makes sense because I'm moving all those bright pixels away from their source.
Any thoughts?
Please Log in or Create an account to join the conversation.
- kingeric1992
My flickr: www.flickr.com/photos/125864770@N06/
ported version, haven't tested in reshade.
//config
#define CA_Curve 2
#define CA_Scale 0.005
#define CA_BlurScale 0.2
//distortion function
float2 Distortion( float2 coord, float curve, float scale)
{
float r = length(coord);
return pow( 2 * r, curve) * coord/r * scale;
}
float4 PS_Chromatic_Pre(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
{
//.rgb == color, .a == offset
// or use preprocessor to set values in config
float4 Spectrum[7] =
{
float4(1.0, 0.0, 0.0, 1.0),//red
float4(1.0, 0.5, 0.0, 0.7),//orange
float4(1.0, 1.0, 0.0, 0.3),//yellow
float4(0.0, 1.0, 0.0, 0.0),//green
float4(0.0, 0.0, 1.0, -0.6),//blue
float4(0.3, 0.0, 0.5, -0.8),//indigo
float4(0.1, 0.0, 0.2, -1.0) //purple
};
float2 pixelSize = {1, ScreenSize.z}; //ratio fix
float2 offset = (texcoord - 0.5) * pixelSize; //length to center with ratio correction
offset = Distortion(offset, CA_Curve, CA_Scale) / pixelSize;
float4 CA = 0;
for(int i=0; i<7 i++)
CA.rgb = max(CA.rgb, tex2D(RFX_backbufferColor, texcoord - offset * Spectrum[i].a).rgb * Spectrum[i].rgb);
return CA ;
}
float4 PS_Chromatic_Main(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
{
float2 pixelSize = {1, ScreenSize.z}; //ratio fix
float weight[11]= {0.082607, 0.080977, 0.076276, 0.069041, 0.060049, 0.050187, 0.040306, 0.031105, 0.023066, 0.016436, 0.011254};
float4 CA = tex2D(ChroScaleSampler, texcoord ) * weight[0];
float2 offset = (texcoord - 0.5) * pixelSize;
offset = Distortion(offset, CA_Curve, CA_Scale) * CA_BlurScale * 0.1 / pixelSize ;
for(int i=1; i<11; i++)
{
CA += tex2D(ChroScaleSampler, texcoord + offset * i) * weight[i];
CA += tex2D(ChroScaleSampler, texcoord - offset * i) * weight[i];
}
return CA;//or to other PP
}
As you can see, blur radius is matching to CA scale, around 1/10 CA_Scale looks pretty decent to me.
also CA is distortion alright, light with different wavelength can't focused on same spot == off focus == blur.
Please Log in or Create an account to join the conversation.
- DeMondo
I found this: an animated example of excellent chromatic aberration:
vine.co/v/eJtX7q1XZmV
a snapshot from it:
Please Log in or Create an account to join the conversation.
- kingeric1992
true, it looks like analog 3D...DeMondo wrote: [because too sharp CA doesnt look good]
In addition to CRT CA effect, it will only disperse to RGB color because the screen thingy.
optical CA disperse into full spectrum if scale is high enough, a good example is Dispersive prism, which resembled some geometry similarity to lens' edge.
Please Log in or Create an account to join the conversation.
kingeric1992 wrote: Tested in ENB
My flickr: www.flickr.com/photos/125864770@N06/
ported version, haven't tested in reshade.//config #define CA_Curve 2 #define CA_Scale 0.005 #define CA_BlurScale 0.2
Warning: Spoiler!//distortion function float2 Distortion( float2 coord, float curve, float scale) { float r = length(coord); return pow( 2 * r, curve) * coord/r * scale; } float4 PS_Chromatic_Pre(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR { //.rgb == color, .a == offset // or use preprocessor to set values in config float4 Spectrum[7] = { float4(1.0, 0.0, 0.0, 1.0),//red float4(1.0, 0.5, 0.0, 0.7),//orange float4(1.0, 1.0, 0.0, 0.3),//yellow float4(0.0, 1.0, 0.0, 0.0),//green float4(0.0, 0.0, 1.0, -0.6),//blue float4(0.3, 0.0, 0.5, -0.8),//indigo float4(0.1, 0.0, 0.2, -1.0) //purple }; float2 pixelSize = {1, ScreenSize.z}; //ratio fix float2 offset = (texcoord - 0.5) * pixelSize; //length to center with ratio correction offset = Distortion(offset, CA_Curve, CA_Scale) / pixelSize; float4 CA = 0; for(int i=0; i<7 i++) CA.rgb = max(CA.rgb, tex2D(RFX_backbufferColor, texcoord - offset * Spectrum[i].a).rgb * Spectrum[i].rgb); return CA ; } float4 PS_Chromatic_Main(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR { float2 pixelSize = {1, ScreenSize.z}; //ratio fix float weight[11]= {0.082607, 0.080977, 0.076276, 0.069041, 0.060049, 0.050187, 0.040306, 0.031105, 0.023066, 0.016436, 0.011254}; float4 CA = tex2D(ChroScaleSampler, texcoord ) * weight[0]; float2 offset = (texcoord - 0.5) * pixelSize; offset = Distortion(offset, CA_Curve, CA_Scale) * CA_BlurScale * 0.1 / pixelSize ; for(int i=1; i<11; i++) { CA += tex2D(ChroScaleSampler, texcoord + offset * i) * weight[i]; CA += tex2D(ChroScaleSampler, texcoord - offset * i) * weight[i]; } return CA;//or to other PP }
As you can see, blur radius is matching to CA scale, around 1/10 CA_Scale looks pretty decent to me.
also CA is distortion alright, light with different wavelength can't focused on same spot == off focus == blur.
Is this CA code usable? Like, can i replace the correct lines and make it work with the downloaded version?
EDIT: Tried to make the code work, gave an error: X3017: initial value does not match variable type
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
kingeric1992 wrote: Tested in ENB
My flickr: www.flickr.com/photos/125864770@N06/
ported version, haven't tested in reshade.//config #define CA_Curve 2 #define CA_Scale 0.005 #define CA_BlurScale 0.2
Warning: Spoiler!//distortion function float2 Distortion( float2 coord, float curve, float scale) { float r = length(coord); return pow( 2 * r, curve) * coord/r * scale; } float4 PS_Chromatic_Pre(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR { //.rgb == color, .a == offset // or use preprocessor to set values in config float4 Spectrum[7] = { float4(1.0, 0.0, 0.0, 1.0),//red float4(1.0, 0.5, 0.0, 0.7),//orange float4(1.0, 1.0, 0.0, 0.3),//yellow float4(0.0, 1.0, 0.0, 0.0),//green float4(0.0, 0.0, 1.0, -0.6),//blue float4(0.3, 0.0, 0.5, -0.8),//indigo float4(0.1, 0.0, 0.2, -1.0) //purple }; float2 pixelSize = {1, ScreenSize.z}; //ratio fix float2 offset = (texcoord - 0.5) * pixelSize; //length to center with ratio correction offset = Distortion(offset, CA_Curve, CA_Scale) / pixelSize; float4 CA = 0; for(int i=0; i<7 i++) CA.rgb = max(CA.rgb, tex2D(RFX_backbufferColor, texcoord - offset * Spectrum[i].a).rgb * Spectrum[i].rgb); return CA ; } float4 PS_Chromatic_Main(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR { float2 pixelSize = {1, ScreenSize.z}; //ratio fix float weight[11]= {0.082607, 0.080977, 0.076276, 0.069041, 0.060049, 0.050187, 0.040306, 0.031105, 0.023066, 0.016436, 0.011254}; float4 CA = tex2D(ChroScaleSampler, texcoord ) * weight[0]; float2 offset = (texcoord - 0.5) * pixelSize; offset = Distortion(offset, CA_Curve, CA_Scale) * CA_BlurScale * 0.1 / pixelSize ; for(int i=1; i<11; i++) { CA += tex2D(ChroScaleSampler, texcoord + offset * i) * weight[i]; CA += tex2D(ChroScaleSampler, texcoord - offset * i) * weight[i]; } return CA;//or to other PP }
As you can see, blur radius is matching to CA scale, around 1/10 CA_Scale looks pretty decent to me.
also CA is distortion alright, light with different wavelength can't focused on same spot == off focus == blur.
Very nice! Another reminder that I don't know how to code, haha, this is so much cleaner than the mess of code I have right now. I like how you did the spectrum, I have been struggling to get a good mix of color, this is a much better solution! Also didn't know the length intrinsic, that looks helpful.
Please Log in or Create an account to join the conversation.
- kingeric1992
I really don't know, have no experience with reshade.
@loxa
thx, I'm still in learning process, and reading others code helped me a lot.
Please Log in or Create an account to join the conversation.
kingeric1992 wrote: @matsilagi
I really don't know, have no experience with reshade.
@loxa
thx, I'm still in learning process, and reading others code helped me a lot.
Ah, ok, no prob.
If anyone else knows how to fix that bug, lemme know, don't be shy.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Here is a link to the original image for comparison. i.imgur.com/sguEMkQ.jpg
And here is the file. Install instructions are included with the download.
Download Chromatic Aberration for ReShade + Framework
If you added the previous CA shader that was included with the Color Filter test, you will need to remove that from the Mediator before using this one.
Also, a lot of the stuff isn't working right now, it's pretty much limited to the multi-color CA (CA_Type 4 in the settings) with lens distortion.
Please Log in or Create an account to join the conversation.