Chromatic Aberration MotionBlur
- ShapeShiftingGhost
- Topic Author
Less
More
6 years 1 month ago - 6 years 1 month ago #1
by ShapeShiftingGhost
Chromatic Aberration MotionBlur was created by ShapeShiftingGhost
Is is practical to have a shader that uses chromatic aberration for motion blur, so that only when the camera frame moves the distortion of color creates an illusion of motion blur.
Last edit: 6 years 1 month ago by ShapeShiftingGhost.
Please Log in or Create an account to join the conversation.
- luluco250
Less
More
You mean to blur each color channel in different degrees? Could be interesting and not hard at all to implement.
Something like this should work: pastebin.com/NX05AGZ4
I just wrote it up on my phone so I can't test it.
Something like this should work: pastebin.com/NX05AGZ4
I just wrote it up on my phone so I can't test it.
The following user(s) said Thank You: Scorpio82CO
Please Log in or Create an account to join the conversation.
- DeMondo
Less
More
luluco250 wrote: You mean to blur each color channel in different degrees? Could be interesting and not hard at all to implement.
Something like this should work: pastebin.com/NX05AGZ4
I just wrote it up on my phone so I can't test it.
---
- Ive tried your new shader but received this message:
Failed to compile .. Chromatic_Aberration_MotionBlur.fx(11, 9): error X3000: syntax error: unexpected 'identifier'
Please Log in or Create an account to join the conversation.
- ShapeShiftingGhost
- Topic Author
Less
More
6 years 3 days ago #4
by ShapeShiftingGhost
Replied by ShapeShiftingGhost on topic Chromatic Aberration MotionBlur
There is a error in the code
Please Log in or Create an account to join the conversation.
Line number 11 must beHere's the full code:
uniform float fFrameTime <source = "frametime";>;
Warning: Spoiler!
#include "ReShade.fxh"
uniform float3 f3ShutterSpeed <
ui_label = "Shutter Speed";
ui_type = "drag";
ui_min = 0.1;
ui_max = 100.0;
ui_step = 0.1;
> = float3(1.0, 1.0, 1.0);
uniform float fFrameTime <source = "frametime";>;
sampler2D sBackBuffer {
Texture = ReShade::BackBufferTex;
SRGBTexture = true;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = POINT;
};
texture2D tChromaticMotion_Last {
Width = BUFFER_WIDTH;
Height = BUFFER_HEIGHT;
};
sampler2D sLast {
Texture = tChromaticMotion_Last;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = POINT;
};
float4 PS_Blend(
float4 position : SV_POSITION,
float2 uv : TEXCOORD
) : SV_TARGET {
float3 curr = tex2D(sBackBuffer, uv).rgb;
float3 last = tex2D(sLast, uv).rgb;
float d = fFrameTime * 0.001;
curr = lerp(last, curr, d / f3ShutterSpeed);
return float4(curr, 1.0);
}
float4 PS_Save(
float4 position : SV_POSITION,
float2 uv : TEXCOORD
) : SV_TARGET {
return tex2D(sBackBuffer, uv);
}
technique ChromaticMotion {
pass Blend {
VertexShader = PostProcessVS;
PixelShader = PS_Blend;
SRGBWriteEnable = true;
}
pass Save {
VertexShader = PostProcessVS;
PixelShader = PS_Save;
RenderTarget = tChromaticMotion_Last;
}
}
Please Log in or Create an account to join the conversation.
- Spectre
Less
More
Could you do something similar to the effect found in the ChromaticAberration.fx where you can change the strength of the effect.
Please Log in or Create an account to join the conversation.