Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.03a - Faster recovery

Post by Pixel Eater »

Beezle wrote:Hey Pixel Eater, normally I dislike motion blur in 1st person shooters but with the right settings, it actually works pretty well. I think you did a decent job here implementing it and the settings for it. By default its just a tad too much, but my personal settings are Samples - 5, Strength - 40 or 48, Recovery - on the default 64, and Blend - Lighten. I'd recommend these settings to anyone using this. Thanks Pixel Eater!
Thanks Beezle! In that case I'll make the default strength 44 for the next release :thumb:
Zemakat
Posts: 117
Joined: Sat Apr 01, 2017 5:11 pm
Preferred Pronouns: He/Him
Graphics Processor: Intel (Modern GZDoom)
Location: United States

Re: Simple Motion Blur 1.03a - Faster recovery

Post by Zemakat »

Pixel Eater wrote:
Remaker wrote:Yup, it goes away when it's off. However, another glitch with the new version is that normal mode makes everything look white. Unlike the black screen glitch, it doesn't intrude the status bar or the player weapon sprite, it just simply leaves the rest of my vision white, like as if the map is only a white void.
Thanks for keeping me up to date Remaker. Unfortunately it really seems like it's due to a bigger issue than the shader itself- it's defined as 'beforebloom' which means it can only affect what's behind the player sprite. If the glitch is happening in front of the status bar it's either hardware or something happening within GZDoom itself. That said, try this one and see if anything improves:
MBlur1.03x.pk3
I've marked it "x" as it's a regression because it gets the screen height within the shader itself rather than from zscript.
Just wanted to say I tried it out. Seems like the "white void" glitch still occurs. Since it might be hardware, I guess there isn't much else that could be done.

But even with that, thanks for everything, because I appreciate your efforts. =:)
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.03a - Faster recovery

Post by Pixel Eater »

Thanks for bug testing and sorry I wasn't able to help :(
Beezle
Posts: 139
Joined: Thu Aug 16, 2018 6:48 pm

Re: Simple Motion Blur 1.03a - Faster recovery

Post by Beezle »

Pixel Eater wrote:
Beezle wrote:Hey Pixel Eater, normally I dislike motion blur in 1st person shooters but with the right settings, it actually works pretty well. I think you did a decent job here implementing it and the settings for it. By default its just a tad too much, but my personal settings are Samples - 5, Strength - 40 or 48, Recovery - on the default 64, and Blend - Lighten. I'd recommend these settings to anyone using this. Thanks Pixel Eater!
Thanks Beezle! In that case I'll make the default strength 44 for the next release :thumb:
You know what, I actually find Strength - 48 to be better but I honestly think default setting are perfectly fine the way you had them. I've only seen 2 other mods with Motion Blur built in and they had the default settings right where you did. It's a good place to start and I'd imagine most people wouldn't need to tweak them much from there, thank you though. :D
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Simple Motion Blur 1.03a - Faster recovery

Post by _mental_ »

Finally I found the source of this motion blur shader used in several mods.

I'm not a fan of motion blur effect but it's irrelevant if I can disable it.
However, using integrated Intel graphics I'm seeing something like this.
Screenshot_Doom_20190430_164927.png
It's the starting location of Doom 2 MAP01 which is obvious I guess :lol:
Depending on the current phase of the moon it's sometimes impossible to read anything in menu and console.

Here is a whole shader, the comment is mine.

Code: Select all

void main()
{
	vec4 C	;  // <-- no initialization, should be something like: vec4 C = vec4(.0, .0, .0, 1.);
	int i ;
	
	if( blendmode == 1 )
	{
		for( i = 0; i < samples; i++ )
		{
			C.rgb += max( C.rgb, texture( InputTexture, TexCoord + steps * i ).rgb ) * increment ;
		}
	}
	else
	{
		for( i = 0; i < samples; i++ )
		{
			C.rgb += texture( InputTexture, TexCoord + steps * i ).rgb * increment ;
		}
	}
	
	FragColor = C ;
}
OpenGL Shading Language spec wrote:Reading a variable before writing (or initializing) it is legal, however the value is undefined.
The shader will work only if uninitialized variables are set to zeroes. If driver doesn't do this (and it shouldn't according to the spec), the result will be random.
Both branches read C.rgb without writing to it previously. Could you please fix this?
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.03a - Faster recovery

Post by Pixel Eater »

_mental_ wrote:The shader will work only if uninitialized variables are set to zeroes. If driver doesn't do this (and it shouldn't according to the spec), the result will be random.
Both branches read C.rgb without writing to it previously. Could you please fix this?
Thanks for figuring this out _mental_, hopefully it will also solve what Remaker was seeing :)

It's a quick fix but I'll try and squeeze some tweaks into the same update first.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Pixel Eater »

Should be okay now, thanks again for the heads up.

There's some new stuff added, mainly the dynamic sample option which speeds things up considerably (at least for me). People may want to increase the sample amount in combination with it in order to actually see a difference though- but it's worth it.
Also the shader responds to the player's velocity now so that strafing and jumping etc. will blur if wanted. Finding a level with a death drop can be fun too.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Caligari87 »

Yay new version! Hopefully this fixed my Vulkan bug too, which was very similar to the one described above. Since I can't try it for several hours: Does it apply "zoom" blurring to forward and backward motion as well? Or just horizontal/vertical?

8-)
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Pixel Eater »

I hope so- kudos to _mental_ for that :D

It doesn't do zoom so far (And I think it would look bad without depth buffer access anyway). It does use forward/backward movement to blur the floor and ceiling the further you look up or down though. Strafe blurring is applied at every pitch level.
User avatar
namsan
Posts: 147
Joined: Sat Mar 31, 2012 4:27 am
Preferred Pronouns: He/Him
Location: Japan

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by namsan »

I tested the new version of your mod and I like it even more.
motion blur on jumping and falling is pretty cool to see.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Pixel Eater »

Thanks Namsan. I especially love the falling effect too :)

After a little "bread-boarding" I think I could get a zoom effect that won't look like complete ass. It won't happen too soon though.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Caligari87 »

So feature request I suppose. Could the rotational blur (perhaps optionally?) be based on the delta between the player's last and current angle/pitch, instead of mouse input? I play a lot of hideous destructor and it'd be nice if the weapon recoil caused motion blur too.

Slightly relatedly, perhaps the blur intensity could be averaged out over the last few tics instead of per-tic?

8-)
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Nash »

Good work so far. Although TBH I'm not sure how I feel about the velocity blur. While I do welcome its addition (I think I might have requested it, can't remember), I think it looks a bit strange when I am holding down forward and side move (so I'm moving diagonally) and then just by moving the mouse a little during this movement, the image starts to blur...
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Pixel Eater »

I love the idea of the recoil having an effect. When I rework it for zoom blurring I think that'll be easier to implement too.

I reckon you've come across the same issue with it as I have Nash- that when you circle-strafe, your target should be more focused not less.

Considering all these things, this project could deal with a complete rewrite at some time.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Simple Motion Blur 1.04 - Bugfix & Velocity awareness

Post by Nash »

Ah yes, circle strafing does produce the effect that I felt a strange about.
Post Reply

Return to “Shaders”