Skip to content

Shows how to support rendering per-instance motion vectors within Indirect instanced drawing of Unity.

Notifications You must be signed in to change notification settings

keijiro/InstancedMotionVector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InstancedMotionVector

screenshot screenshot

This is an example that shows how to support rendering per-instance motion vectors within indirect instanced drawing of Unity.

(In this document, the term "indirect instanced drawing" refers to drawing instanced geometries with using the indirect drawing API -- specifically using Graphics.DrawMeshInstancedIndirect.)

System requirements

  • Unity 2017.2 or later

This example uses BuiltinRenderTextureType.MotionVectors that is newly introduce in Unity 2017.2, so that it only runs on 2017.2 or later versions.

How to support motion vectors within indirect instanced drawing

  • Write the MotionVectors light mode pass for the custom shader. It's recommended to use the first pass of the subshader to make it easy to refer from command buffers. ⇒ Example

  • Implement the OnRenderObject method and manually invoke the MotionVectors pass with using a command buffer. BuiltinRenderTextureType.MotionVectors can be used to set the motion vectors texture as a render target. ⇒ Example

License

Copyright (c) 2017 Unity Technologies

This repository is to be treated as an example content of Unity; you can use the code freely in your projects. Also see the FAQ about example contents.

About

Shows how to support rendering per-instance motion vectors within Indirect instanced drawing of Unity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published