kMotion
kMotion copied to clipboard
Help needed
kMotion doesn't work, even after applying @EsiNikko's hotfixes, and I keep getting these warning logs:
CommandBuffer: temporary render texture _CameraColorTexture not found while executing Motion Blur (Blit source)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
and
CommandBuffer: temporary render texture _CameraColorTexture not found while executing Motion Blur (Blit destination)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Is there a way to fix this issue? (2021.3.6f1)
I‘m using 2021.3.6f1 and also applied @EsiNikko's hotfixes. Try following steps:
-
In
MotionBlurRenderPass.cs
// comment out this line, and use next line // var colorTextureIdentifier = new RenderTargetIdentifier("_CameraColorTexture"); var colorTextureIdentifier = renderingData.cameraData.renderer.cameraColorTarget;
-
Note Unity 2021.3.6f1 already include source code of kMotion, with same shader name but slightly different implementation (What a surprise!). So
Shader.Find()
may result finding the wrong version of kMotion shader. Change shader name in 1st line ofCameraMotionVectors.shader
andObjectMotionVectors.shader
. Then InMotionVectorRenderPass.cs
, change these lines:const string kCameraShader = "Hidden/kMotion/CameraMotionVectors"; // use new shader name const string kObjectShader = "Hidden/kMotion/ObjectMotionVectors"; // use new shader name
-
In
ObjectMotionVectors.shader
, comment out following lines once you see redefinition warning in Editor log.float4x4 unity_MatrixPreviousM; float4 unity_MotionVectorsParams;
@caogtaa You are a savior! By downloading @EsiNikko 's version (link) and following all your steps, I got object-based motion blur working with Unity 2022.1.20f1 and URP 13.1.8 🙏
I‘m using 2021.3.6f1 and also applied @EsiNikko's hotfixes. Try following steps:
- In
MotionBlurRenderPass.cs
// comment out this line, and use next line // var colorTextureIdentifier = new RenderTargetIdentifier("_CameraColorTexture"); var colorTextureIdentifier = renderingData.cameraData.renderer.cameraColorTarget;
- Note Unity 2021.3.6f1 already include source code of kMotion, with same shader name but slightly different implementation (What a surprise!). So
Shader.Find()
may result finding the wrong version of kMotion shader. Change shader name in 1st line ofCameraMotionVectors.shader
andObjectMotionVectors.shader
. Then InMotionVectorRenderPass.cs
, change these lines:const string kCameraShader = "Hidden/kMotion/CameraMotionVectors"; // use new shader name const string kObjectShader = "Hidden/kMotion/ObjectMotionVectors"; // use new shader name
- In
ObjectMotionVectors.shader
, comment out following lines once you see redefinition warning in Editor log.float4x4 unity_MatrixPreviousM; float4 unity_MotionVectorsParams;
thanks