# Previous position/velocity in material (no bp)

**URL:** <https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981>\
**Category:** Rendering\
**Tags:** unreal-engine, velocity, custom-nodes, UE4, hlsl, question\
**Created:** [February 21, 2018, 7:52pm UTC](https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981 "2018-02-21T19:52:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SbingBong](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SbingBong](https://forums.unrealengine.com/u/SbingBong)\
**Post date:** [February 21, 2018, 7:52pm UTC](https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981/1 "2018-02-21T19:52:22Z")

</div>

I’m hoping someone knows a way to either store and retrieve next frame a value in a custom node or if there’s any HLSL code to get the last position. I want to avoid BP setting parameter as I could have hundreds at any time needing access to it every frame. Velocity would work too as it’s the end goal.

Thanks

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [February 21, 2018, 11:33pm UTC](https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981/2 "2018-02-21T23:33:29Z")

</div>

there is a previous frame switch in the material editor.

> **[How to use the Previous Frame Switch node?](https://forums.unrealengine.com/questions/593581/how-to-use-the-previous-frame-switch-node.html)**
>
> It's a new node in 4.15, but I can't find any info on how to use it. Here is a video that shows the effect (less blur caused by Temporal AA, when passing parameters from blueprints): https://www.youtube.com/watch?v=YbjqiNZr4K4 You can also read...

---

<div class="post-metadata">

**Author:** ![Santaiko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Santaiko](https://forums.unrealengine.com/u/Santaiko)\
**Post date:** [August 30, 2024, 5:43pm UTC](https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981/3 "2024-08-30T17:43:57Z")

</div>

Does the previews frame node output last frame world position? All they information of the node says it only can be used for WPO animation

---

<div class="post-metadata">

**Author:** ![BananableOffense](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BananableOffense](https://forums.unrealengine.com/u/BananableOffense)\
**Post date:** [August 30, 2024, 6:27pm UTC](https://forums.unrealengine.com/t/previous-position-velocity-in-material-no-bp/417981/4 "2024-08-30T18:27:07Z")

</div>

No it doesn’t, but you can sample the velocity buffer in some materials, which combined with the current world position can be used to find the previous world position.
