Coder Social home page Coder Social logo

Help getting this to work on 2019.4 about kmotion HOT 7 OPEN

kink3d avatar kink3d commented on June 27, 2024
Help getting this to work on 2019.4

from kmotion.

Comments (7)

EsiNikko avatar EsiNikko commented on June 27, 2024

Hi.
I'm already using it in Unity 2019.4.x with no problem, but I had to apply some fixes that I suggested in the pull request. I even added the ability to filter motion-blurred objects with a LayerMask field. I will push this new feature in another branch someday soon.
by the way, if you tell the exact version of the Unity you trying to use, I'll give it a try and let you know if I had any solution.

from kmotion.

PpHammer avatar PpHammer commented on June 27, 2024

Hi EsiNikko!

Thanks for your reply! I am on 2019.4.2f1 and URP 7.4.3.

I can get it to work - more or less - as per your fixes but I am not getting proper results.
Weirdly enough when I drive backwards the effects seems to work ok - when racing forward I only have the effect in the bottom right.

The camera is following the car - it is not linked or anything - it is just following it in LateUpdate.
Don't know what to check yet atm... :(

PIeter

from kmotion.

PpHammer avatar PpHammer commented on June 27, 2024

I just can't get it to work in 2019.4.12.

I have implemented the changes as suggested by EsiNikko, but the best I can get is motionblur when moving backwards. Or motionblur on the right side of the screen - but smeared to the right.

It also 'ticks' as if one frame it is rendered the other frame it is not - my guess is that this is related to my camera being updated in fixedUpdate.

Long story short - this seems to be the best solution for object motion blur for urp at the moment - but it is a bit fiddly to get to work

from kmotion.

PpHammer avatar PpHammer commented on June 27, 2024

BlurLowerRight

This is the effect I currently have - this happens when the camera is moving forward.

Anyone?

from kmotion.

fleity avatar fleity commented on June 27, 2024

I have this setup using @EsiNikko branch and while it does work somewhat I can probably report the same issue as PpHammer. I spin an object in a circle and during 3/4 of the rotation the motion blur works but during one quarter the object is not blurred at all. It seems dependent on the view direction of the camera as it is always the same part of the rotation (lower right part of the circle, towards the camera).
Unity 2019.4.16f1 - URP 7.5.3

from kmotion.

ThomasChen1220 avatar ThomasChen1220 commented on June 27, 2024

I looked into the code and the reason why it's doing this is probably because the velocity texture is using RGBA32 when it should be using RGFloat.
image

To fix this, in MotionVectorRenderPass.cs after line 49, add :
cameraTextureDescriptor.colorFormat = RenderTextureFormat.RGFloat;

Also in MotionVector.shader, change line 20 to this:
TEXTURE2D_FLOAT(_MotionVectorTexture); SAMPLER(sampler_MotionVectorTexture);

from kmotion.

fleity avatar fleity commented on June 27, 2024

Over on EsiNikko's and my fork we fixed that texture format issue and a bunch of smaller other issues as well. Additionally to the RGFloat format (which isn't supported on many mobiles devices I've heard, probably the reason it was a more regular one) you have to change the shader to (un-)pack it correctly and when clearing the texture clear it with 0.5 instead of zero.

from kmotion.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.