# MediaTexture doesn't work with RGBtoHSV or world displacement

**URL:** <https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546>\
**Category:** Rendering\
**Tags:** unreal-engine, tessellation, question\
**Created:** [October 20, 2017, 10:06pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546 "2017-10-20T22:06:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fb9aef0e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fb9aef0e](https://forums.unrealengine.com/u/anonymous_user_fb9aef0e)\
**Post date:** [October 20, 2017, 10:06pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/1 "2017-10-20T22:06:08Z")

</div>

We are trying to use a media texture MP4 file to drive a media texture with animated world displacement.

The way we used to do it in 4.16 is have a split texture, with RGB on one side and HSV color gradient in another, this way we could split the depth into 360 steps of hue, and use the V channel for a 2bit mask.

In the latest preview (4) the RGBtoHSV node errors out with “(Node If) If input A must be of type float.” and won’t compile.

 ![217395-depth-rgb-to-hsv-broken.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/4/fa4b2115fa5bf1011be55eb2a74802892a964bb7.jpeg)

Even if we drop the RGBtoHSV and just grab a single color channel and pipe that directly into world displacement. Nothing happens, the tessellation is active in wire view but no displacement occurs.

 ![217396-nodisplacementpng.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/7/827263d0c6d2609fb6315edff9f463054443c141.jpeg)

Does that mean the change to having to use sampler type: External kills being able to use mediatextures for anything other than emissive and base color now?

This totally kills our project.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [October 24, 2017, 2:11pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/2 "2017-10-24T14:11:32Z")

</div>

The problem is that the sampler’s white pin outputs a float4, but the RgbToHsv function expects a float3. One simple way to fix this is to insert a MakeFloat3 node and wire it up to the RGB components of the sampler.

 ![217765-externalsamplertohsv.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/f/8cf4eefb8ce3bb050bc6a99989b04639f98f31f2.jpeg)

---

<div class="post-metadata">

**Author:** ![TomVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TomVR](https://forums.unrealengine.com/u/TomVR)\
**Post date:** [October 25, 2017, 2:00pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/3 "2017-10-25T14:00:16Z")

</div>

![217847-noluck.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/8/0b892b5cb103a8e226775791fc97534a7070dcbd.png)

No change in error message

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [October 25, 2017, 2:52pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/4 "2017-10-25T14:52:28Z")

</div>

Did you recompile the BP?

---

<div class="post-metadata">

**Author:** ![TomVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TomVR](https://forums.unrealengine.com/u/TomVR)\
**Post date:** [October 25, 2017, 3:36pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/5 "2017-10-25T15:36:30Z")

</div>

Yes.

The input video is an 8bit h264 1080p video @ 30 fps

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [October 25, 2017, 10:02pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/6 "2017-10-25T22:02:03Z")

</div>

I cannot repro you problem in 4.18 (final release). Perhaps something is different in the Preview version.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fb9aef0e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fb9aef0e](https://forums.unrealengine.com/u/anonymous_user_fb9aef0e)\
**Post date:** [October 26, 2017, 4:37pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/7 "2017-10-26T16:37:28Z")

</div>

This is will final release.

Also you are plugging it into the emissive, we are using the output of the RGBtoHSV in world displacement.

I just made a clean 4.18 project and set up this material. It works fine plugged into base color or emissive, but gives the error on world displacement

 ![218042-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/5/335b3691bde488b39672c08f9a8e50a70ee344c3.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fb9aef0e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fb9aef0e](https://forums.unrealengine.com/u/anonymous_user_fb9aef0e)\
**Post date:** [October 26, 2017, 4:39pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/8 "2017-10-26T16:39:25Z")

</div>

![218043-noissue-emissive.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/b/69bbcc69cbb8b543605ef40ec17ac2c3982d9c79.jpeg)

here is it working fine if plugged into emissive.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [October 26, 2017, 5:59pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/9 "2017-10-26T17:59:23Z")

</div>

I was able to repro WorldPositionOffset not working. This seems to be a shader compiler bug. I will reassign this ticket to the Tools Team.

---

<div class="post-metadata">

**Author:** ![TomVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TomVR](https://forums.unrealengine.com/u/TomVR)\
**Post date:** [October 28, 2017, 4:32pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/10 "2017-10-28T16:32:34Z")

</div>

Is there a publicly trackable ticket? We really want to get from 4.16 to 4.18 but this bug is holding us back at the moment.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [October 30, 2017, 4:34pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/11 "2017-10-30T16:34:52Z")

</div>

I added UE-51763, which should be accessible at [Unreal Engine Issues and Bug Tracker (UE-51762)](https://issues.unrealengine.com/issue/UE-51762) soon

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [November 2, 2017, 8:54pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/12 "2017-11-02T20:54:11Z")

</div>

This should be fixed in CL# 3733463. The problem was that the media texture only supports per-pixel attributes, but not does not support per-vertex attributes, which is a requirement for WorldPositionOffset to work.

Our external texture implementation did not return a correct error code, so the shader compiler spit out a completely misleading error message instead. The fix adds appropriate error messages to external textures. Please note that this will not make WorldPositionOffset work with media textures, but only that an appropriate error message will be printed by the shader compiler.

I will merge this change into 4.18 Hotfix 1.

---

<div class="post-metadata">

**Author:** ![TomVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TomVR](https://forums.unrealengine.com/u/TomVR)\
**Post date:** [November 3, 2017, 3:39pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/13 "2017-11-03T15:39:00Z")

</div>

Is there any plans to allow media textures to work woth worldpositionoffset again or allow the use of the other texture sampler modes?

---

<div class="post-metadata">

**Author:** ![Kajiisan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kajiisan/32/443102_2.png) [@Kajiisan](https://forums.unrealengine.com/u/Kajiisan)\
**Post date:** [December 8, 2017, 7:17pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/14 "2017-12-08T19:17:59Z")

</div>

We experience an similar problem here (4.18.1):

Material Function for dissolve effect:

[https://i.imgur.com/0xxvpN6.png](https://i.imgur.com/0xxvpN6.png)

And the Material BP:

[https://i.imgur.com/JxLkNyU.png](https://i.imgur.com/JxLkNyU.png)

When we create the Material BP it works fine but once we add some UV changing node (rotation for mask for example) this error occurs. Any idea?

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [December 8, 2017, 7:25pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/15 "2017-12-08T19:25:20Z")

</div>

It’s currently tracked as a critical bug for 4.19 in UE-52612, but I’m not sure if a fix will make it in.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [December 8, 2017, 7:26pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/16 "2017-12-08T19:26:23Z")

</div>

External texture samplers do not currently work with materials that require vertex shaders. It’s currently tracked as a critical bug (UE-52612).

---

<div class="post-metadata">

**Author:** ![TomVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TomVR](https://forums.unrealengine.com/u/TomVR)\
**Post date:** [December 28, 2017, 6:21pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/17 "2017-12-28T18:21:37Z")

</div>

I cant seem to find that bug on the tracker, was it taken down?

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-52612)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [January 8, 2018, 4:19pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/18 "2018-01-08T16:19:12Z")

</div>

Sorry, there was a typo in my link. I updated it. Your link is the correct one, thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fb9aef0e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fb9aef0e](https://forums.unrealengine.com/u/anonymous_user_fb9aef0e)\
**Post date:** [January 9, 2018, 6:10pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/19 "2018-01-09T18:10:41Z")

</div>

I hope the regression is fixed in 4.19.

6-DOF 360 video is starting to become viable with cameras like the Kandao Obsidian outputting 360 depth maps. Being able to drive vertex shaders with h264/h265 video makes it viable. Hopefully when oculus go/gearvr finally gets on the vulkan train it can work on mobile as well.

example (built in unity )

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fb9aef0e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fb9aef0e](https://forums.unrealengine.com/u/anonymous_user_fb9aef0e)\
**Post date:** [January 17, 2018, 6:26pm UTC](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546/20 "2018-01-17T18:26:49Z")

</div>

![227423-still-broken.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/a/51af715e2e9eaaa985279c3e478a4cc2b4a0d821.jpeg)

I looking at the 4.19 preview it looks like it’s still broken. I guess we are transitioning to unity

[Next page](https://forums.unrealengine.com/t/mediatexture-doesnt-work-with-rgbtohsv-or-world-displacement/407546.md?page=2)
