Motion blur has always been a problem with fast rotating objects. It looks very bad on car wheels. I know HDRP will allow Custom motion vector in shader graph in the future, but is there no way to fix the motion vector of wheels right now?
While examining the custom pass volume, I realized that I can choose motion vector in material pass name. I wonder if I can do it using this.
I’ve done this on the old style way (there’s an example from PPv1 for custom movecs for wheels). That sample just used additional cage mesh with shader that mainly had movec pass on it. You’d want the cage mesh if your wheel meshes have holes but otherwise you could probably go with that custom pass route for movecs.
You need to mod the shader a bit to function in HDRP, at very least you need to change line 15 to:
ZTest Less Cull Back ZWrite Off
You need this so the ZWrite doesn’t prevent the underlying mesh from rendering.
There are few additional issues with this setup which are not HDRP related (but apply to it as well). That shader only spins the wheel on one direction due to a logic error. To fix that you can swap line 60 to:
c.rg = (c.rg * 2.0 - 1.0) * abs(_MotionAmount); // Using color texture so need to make 0.5 neutral
Additionally, the shader doesn’t scale the motion amount by the wheel size on screen so you have to implement some sort of scaling logic to prevent this from happening if you can zoom in and out to wheels in your gameplay.
Edit: You also need to change the movec pass queue to make sure you actually render the movec after rest (required for newer HDRP versions, shouldn’t hurt to do in the old versions either). You can do it like this:
@rz_0lento I fixed the problem months ago. I forgot to thank you for your help When I added stencil buffer to the shader, I managed to run it properly. but HDRP motion blur effect could not provide the quality blur I wanted.
I found a better solution. Not as an image effect. I’m doing a Blur with a normal object shader. In this way, I get a better quality result than image effect motion blur.
[quote=“Muhammed Emin Aydın, post:8, topic:812408, username:AydinDeveloper”]
I found a better solution. Not as an image effect. I’m doing a Blur with a normal object shader. In this way, I get a better quality result than image effect motion blur.
[/quote]Looks nice, this is traditional preblurred image over regular mesh kinda trick or do you sample the scene color for this?
I created it based on the URP motion blur shader. I’m sampling the scene color with this texture. There are a few problems.
I don’t know what color I should apply for the other surface of the wheel. As shown in the screenshot, Scene color does not work in Scene view, with MSAA turned off or with Deferred rendering. This may be related to the Beta version. or the custom function is related to the way I write. I will rewrite with normal shader soon. HDRP and Default RP will be pretty easy to support.
Instead istarted to try to port this “overhead” kinda “brut force” Motion Blur method to HDRP.
Half way done but i expect some tranparent sorting issues.
However some high quality result should be possible with this.
wow. This looks fantastic.
Does the TAA works too when the car is driving and
how you did it? .-)
I have
6 different HDRP Lit materials for the rim
3 different HDRP Lit materials for the tire
This should render something like this.
But at the moment with default settings the TAA and MotionBlur goes crazy several cm around the complete wheel.
Nice. Didn t know that.
How can i setup the HDRP Lit shader or an HDRP Shadergraph.
Only enable custom velocity and the motion vectors know then they have to rotate?
Hi!
Solution with transparent materials for rims works for me!
But I have more general problem with hdrp motion blur - objects, far from moving camera are jerking. So, i.e. having car hood camera, driving fast, steer slowly, far objects sometimes partially blurred (i mean partially random on each frame, it looks like permanent noise).
Are there any solution for it?
It seems there are lack of some filtering.
The same noise exists for SSR (HDRP 12). I.e. in Unigine engine there are no noise at all.