# Vector displacement map

**URL:** <https://forums.unrealengine.com/t/vector-displacement-map/4328>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [May 14, 2014, 3:01am UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328 "2014-05-14T03:01:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [May 14, 2014, 3:01am UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/1 "2014-05-14T03:01:00Z")

</div>

Has anyone managed to get vector displacement maps working in UE4 yet?

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [May 19, 2014, 10:03pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/2 "2014-05-19T22:03:41Z")

</div>

Got it:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/d/78db6363092ce978c193a14b90467c1812b991e6.jpeg "UE4 Vector Displacement test") ](https://www.youtube.com/watch?v=zm13tOJmdG4)

More to come soon…

---

<div class="post-metadata">

**Author:** ![KingBadger3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KingBadger3D](https://forums.unrealengine.com/u/KingBadger3D)\
**Post date:** [May 20, 2014, 1:13am UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/3 "2014-05-20T01:13:46Z")

</div>

Nice!, We need to have a chat. Ive been working on a screen space filter for Vector Displacement mixed with frustum culling screen z depth distance tessellation. Hope the more to come soon is very soon 🙂

---

<div class="post-metadata">

**Author:** ![redbox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@redbox](https://forums.unrealengine.com/u/redbox)\
**Post date:** [May 20, 2014, 5:39pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/4 "2014-05-20T17:39:49Z")

</div>

what the problem, can you specify?

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [May 20, 2014, 5:52pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/5 "2014-05-20T17:52:20Z")

</div>

I made some that work with [Unity](https://dl.dropboxusercontent.com/u/9194933/UnityAssetStoreDemo/Shaders/VectorDisplacement_1_1/VectorDisplacement_1_1.html), so I’m roughly translating them to work in Unreal. I’ve gotten the Zbrush baked maps to work pretty well. Now I have to get the Xnormal baked maps working and correct the normals.

I could use a map and object baked in mudbox if anyone has one. If there are any other programs that can bake vector maps, let me know.

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [May 25, 2014, 3:22pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/6 "2014-05-25T15:22:23Z")

</div>

Yeah, you have to tessellate the material. Here’s a screenshot of the Zbrush material:

![8b6c05100e488fa71e960644a53db99dd53bbd06.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

The Xnormal material is coming soon. I still need a mudbox example.

---

<div class="post-metadata">

**Author:** ![GregPenn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gregpenn/32/963417_2.png) [@GregPenn](https://forums.unrealengine.com/u/GregPenn)\
**Post date:** [September 15, 2014, 5:36pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/7 "2014-09-15T17:36:19Z")

</div>

Hi folks,

Got a few questions about this not sure if anyones having any joy? That shader is pretty great Electricsauce thanks for sharing :).

Anyhow I am trying this technique on a Dinosaur and wanted to know what Z-Brush settings you are using to generate the displacement? I’ve added mine below, I turned most of the options off as I couldn’t get a 32bit file into UE4

![a37bbc62fd971ec39d52d008da55544cf0b47d88.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

After exporting as a 16bit tiff I converted it to an 8bit TGA, this seems odd but again I couldn’t find a way to get the file into UE4. I did not mess with Photoshop levels, effect the map contrast in anyway.

 ![8bitconvert.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/c/cc6b69cdf677a1b46e4021a4481ac2095c25a0cd.jpeg)

I imported the file into UE4 with the following settings…

 ![Capture.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/4/24c032bfc546f91fb530746ff5cf174a1e7b1eda.jpeg)

I tried to use the material shown above, I removed a few of the functions…

 ![ShaderSetting.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/8/6895b4d91d9022c5770145617d953ac11f9256db.jpeg)

Here are 2 screenshots showing the effect on and off, there is some nice smoothing from the tessellation but the displacement is a bit crude. I guess this is due to the bit depth hammering?

 ![Effect1.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/c/2c973339ea4c660e6730aeaad8d5275b06365e1d.jpeg)

![32d6b2d0e30bd91b5eca78528ddb56b77b075ad8.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

Many thanks for any improvements or alterations in workflow ideas.

Cheers

Greg

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [September 17, 2014, 9:47pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/8 "2014-09-17T21:47:00Z")

</div>

I haven’t figured out specific setting for zbrush just yet, I got sidetracked by my wood projection project. I didn’t have any luck with the vector displacement compression settings so ended up using HDR compression to get the detail that I needed. The shader that I posted above doesn’t deal with object rotation properly and I haven’t had any luck with my Xnormal baked objects.

---

<div class="post-metadata">

**Author:** ![GregPenn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gregpenn/32/963417_2.png) [@GregPenn](https://forums.unrealengine.com/u/GregPenn)\
**Post date:** [September 18, 2014, 8:49am UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/9 "2014-09-18T08:49:18Z")

</div>

Hi electricsauce,

Cheers for the reply, may I see your project/ue4 files please? I cant seem to get anything to work right

I’m currently exporting a 16bit Tif from Z-Brush saving it as a PNG importing into UE4 then applying HDR compression as you suggested but no joy yet.

Cheers

Greg

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [September 18, 2014, 2:30pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/10 "2014-09-18T14:30:52Z")

</div>

I’m using the vector displacement test file located in the lightbox in Zbrush and following the same steps you are. Try multiplying your object scale parameter by 50 to see if you can get the displacement that you’re after.

I’m having issues converting the world direction based VD maps to object space using the built in transform node which isn’t compatible with the pixel shader. Time to use some math.

---

<div class="post-metadata">

**Author:** ![GregPenn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gregpenn/32/963417_2.png) [@GregPenn](https://forums.unrealengine.com/u/GregPenn)\
**Post date:** [September 18, 2014, 3:29pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/11 "2014-09-18T15:29:37Z")

</div>

Brilliant got it working, my mesh was rotated so the vector displacement wasn’t working, now I have the same issue you have where it works only in the default position only.

Cheers

Greg

---

<div class="post-metadata">

**Author:** ![StevePeters](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StevePeters](https://forums.unrealengine.com/u/StevePeters)\
**Post date:** [September 19, 2014, 1:13am UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/12 "2014-09-19T01:13:21Z")

</div>

I’ve had some luck on the rotation issue by using an inverse transform matrix that utilizes blueprint driven parameters. It’s a far from ideal solution though, it’s hard to set up and I have little hope of it working with skeletal meshes since it relies on the objects rotation to determine deformation direction. If your dinosaur turned his head the deformed bumps would stay in their initial positions.

I’m going to try tangent based maps again but I haven’t had much luck with them so far. The (tangent to world) vector transform seems to crack the mesh pretty severely.

---

<div class="post-metadata">

**Author:** ![GregPenn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gregpenn/32/963417_2.png) [@GregPenn](https://forums.unrealengine.com/u/GregPenn)\
**Post date:** [September 19, 2014, 4:23pm UTC](https://forums.unrealengine.com/t/vector-displacement-map/4328/13 "2014-09-19T16:23:53Z")

</div>

Gotcha, yer I’ve tried the transform node to with no joy, the result is very noisy.

Shame theres not just a material function you can drag and drop hehe
