Simple motion blur
- jas01
- Topic Author
Less
More
Hello!
*First of all sorry for my poor grammar*
So I have radial blur effect from this topic: reshade.me/forum/shader-suggestions/61-motion-blur
But this is only static effect. It is possible to get this to work only when I hold/press "w" (key)?... Or when my character is moving. I need a command for this (or something like that). Please help.
best wishes,
jas01
*First of all sorry for my poor grammar*
So I have radial blur effect from this topic: reshade.me/forum/shader-suggestions/61-motion-blur
But this is only static effect. It is possible to get this to work only when I hold/press "w" (key)?... Or when my character is moving. I need a command for this (or something like that). Please help.
best wishes,
jas01
Last edit: 9 years 1 month ago by jas01. Reason: bad link
Please Log in or Create an account to join the conversation.
- crosire
Less
More
ReShade provides a way to check for keyboard input. So:
Now it only shows up while you hold down the W key. It's still static though and the transform is a hard cut, would need some more work to make it smooth.
// true if key is pressed, false otherwise
uniform bool isMovingForward < source = "key"; keycode = 0x57; /* W key */ >;
float4 RadialBlur(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
...
return isMovingForward ? color : tex2D(colorSampler, texcoord);
}
Now it only shows up while you hold down the W key. It's still static though and the transform is a hard cut, would need some more work to make it smooth.
The following user(s) said Thank You: jas01
Please Log in or Create an account to join the conversation.
- jas01
- Topic Author
Less
More
Thank you for answer. I'm glad that i can write with you.
Your method works. But now blur looks strange. The image is moved down. Actually, I have two images now... I'm using MasterEffect. Can this cause the problem? Here are my settings:
www.mediafire.com/download/7sx47cpr8s6585i/ReShade.fx (I am a beginner, so sorry for all my mistakes...)
Here you can see the problem. This happens without holding "w".
www.mediafire.com/download/8ww0mn45tmn63t4/problem.rar
I can change ,,static const float2 BLUR_CENTER = float2(0.5, 0.5)" to ,,static const float2 BLUR_CENTER = float2(0.0, 0.0)" and ,,static const float BLUR_WIDTH = -0.5" to ,,static const float BLUR_WIDTH = -0.01", but then but then the entire screen is also blurred...
Your method works. But now blur looks strange. The image is moved down. Actually, I have two images now... I'm using MasterEffect. Can this cause the problem? Here are my settings:
www.mediafire.com/download/7sx47cpr8s6585i/ReShade.fx (I am a beginner, so sorry for all my mistakes...)
Here you can see the problem. This happens without holding "w".
www.mediafire.com/download/8ww0mn45tmn63t4/problem.rar
I can change ,,static const float2 BLUR_CENTER = float2(0.5, 0.5)" to ,,static const float2 BLUR_CENTER = float2(0.0, 0.0)" and ,,static const float BLUR_WIDTH = -0.5" to ,,static const float BLUR_WIDTH = -0.01", but then but then the entire screen is also blurred...
Last edit: 9 years 1 month ago by jas01. Reason: more information
Please Log in or Create an account to join the conversation.
- crosire
Less
More
- jas01
- Topic Author
Less
More
I added a link for the screenshot in previous post.
/Edit:
I should go to sleep. I'll be available tomorrow.
Good night.
/Edit:
I should go to sleep. I'll be available tomorrow.
Good night.
Last edit: 9 years 1 month ago by jas01. Reason: more information
Please Log in or Create an account to join the conversation.
- crosire
Less
More
9 years 1 month ago - 9 years 1 month ago #6
by crosire
Replied by crosire on topic Simple motion blur
Oh, or course, I'm stupid. Didn't see how that shader subtracts the blur center from texcoord at the top. This works:
Now if you use this with MasterEffect (like you do), to optimize I would move all that after these lines:Then remove these lines:And inside the RadialBlur function, replace "colorSampler" with "SamplerColorLDR".
float4 RadialBlur(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
if (!isMovingForward)
{
return tex2D(SamplerColorLDR, texcoord);
}
texcoord -= BLUR_CENTER;
....
color /= BLUR_SAMPLES;
return color;
}
Now if you use this with MasterEffect (like you do), to optimize I would move all that after these lines:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Functions
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
texture colorTex : COLOR;
sampler colorSampler { Texture = colorTex; };
Last edit: 9 years 1 month ago by crosire.
The following user(s) said Thank You: jas01
Please Log in or Create an account to join the conversation.
- jas01
- Topic Author
Less
More
I'm very sorry that I didn't write to you sooner...
Of course, it works perfectly now. I'm very happy with the result. Looks really nice in Overgrowth by Wolfire Games (action game in third person mode). Thank you very very much.
I want to thank you for all of your hard work. You gave me a reason to smile.
Of course, it works perfectly now. I'm very happy with the result. Looks really nice in Overgrowth by Wolfire Games (action game in third person mode). Thank you very very much.
I want to thank you for all of your hard work. You gave me a reason to smile.
The following user(s) said Thank You: crosire, andrew
Please Log in or Create an account to join the conversation.