# Video in Light Function no longer working

**URL:** <https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207>\
**Category:** Rendering\
**Tags:** projection, light-function, unreal-engine, question\
**Created:** [November 21, 2017, 12:55pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207 "2017-11-21T12:55:24Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuthyrus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zuthyrus](https://forums.unrealengine.com/u/zuthyrus)\
**Post date:** [November 21, 2017, 12:55pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/1 "2017-11-21T12:55:24Z")

</div>

Hello,

Since updating to 4.18, I have discovered that Video / Media files don’t seem to be working with the Light Function material any more.

I am trying to project a video file using a spot light actor, onto people standing in a pool of water. I understand spot lights cant project colour and that is fine as the video is only one colour anyway. I managed to create this before in 4.17 with no issues.

In 4.18 however, I just get an error as soon as i plug the media file into the emissive rollout of the Light Function material.

[SM5] (Node TextureSample) Invalid node used in vertex/hull/domain shader input!

I would just got back to 4.17, but i cant as I’m trailing datasmith,

Any help would be amazing - thank you!

Regards,

Chris

 ![220956-error.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/2/512e309f36a683b434a8929b9e78d79fd306e959.jpeg)

---

<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 21, 2017, 2:14pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/2 "2017-11-21T14:14:00Z")

</div>

MediaTextures in 4.18 use the new External Texture API, which currently only supports pixel shaders. This is because some platforms, such as Android, only have pixel shader support on external textures. We are thinking about enabling vertex shader support on those platforms that support it. I can’t say when this will happen though.

Update: this is being tracked as [Unreal Engine Issues and Bug Tracker (UE-52612)](https://issues.unrealengine.com/issue/UE-52612)

---

<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 21, 2017, 2:18pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/3 "2017-11-21T14:18:35Z")

</div>

I added UE-52612 to track this.

---

<div class="post-metadata">

**Author:** ![zuthyrus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zuthyrus](https://forums.unrealengine.com/u/zuthyrus)\
**Post date:** [November 21, 2017, 3:16pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/4 "2017-11-21T15:16:19Z")

</div>

Thank you for your super fast response! I’m currently developing this for PC platform only with the capability to turn it into a VR scene eventually. Is there no current work around for this?

---

<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 21, 2017, 3:57pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/5 "2017-11-21T15:57:47Z")

</div>

It’s probably not too difficult to make it work, but I don’t know what exactly needs to be done. If you’re interested in implementing this yourself, HLSLMaterialTranslator.h is probably a good starting point (search for ExternalTexture).

---

<div class="post-metadata">

**Author:** ![Alessiana](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alessiana](https://forums.unrealengine.com/u/Alessiana)\
**Post date:** [November 22, 2017, 11:12am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/6 "2017-11-22T11:12:53Z")

</div>

Even if it’s “not too difficult to make it work” I am unable to make it, so if someone find the workaround and would be so kind to share it I would be super thankful!  
Cheers!

---

<div class="post-metadata">

**Author:** ![scavnox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@scavnox](https://forums.unrealengine.com/u/scavnox)\
**Post date:** [November 24, 2017, 9:29pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/7 "2017-11-24T21:29:14Z")

</div>

Same problem here, this is frustrating

---

<div class="post-metadata">

**Author:** ![Alessiana](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alessiana](https://forums.unrealengine.com/u/Alessiana)\
**Post date:** [November 25, 2017, 12:25am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/8 "2017-11-25T00:25:21Z")

</div>

I found a workaround, very ugly but still…

I added a Scenecapture2D camera to the scene with a render texture.  
This 2DCamera is placed in front of a plane where the video is played(the plane is the only thing rendered).  
The render texture is used in the light function instead of the Media Source file.

---

<div class="post-metadata">

**Author:** ![scavnox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@scavnox](https://forums.unrealengine.com/u/scavnox)\
**Post date:** [November 25, 2017, 1:43am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/9 "2017-11-25T01:43:31Z")

</div>

Awesome, works for me. Good enough for what I need. Hopefully there will be a cleaner solution around the corner but for now nice one Alessiana. Cheers

---

<div class="post-metadata">

**Author:** ![thesystemera](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thesystemera](https://forums.unrealengine.com/u/thesystemera)\
**Post date:** [December 21, 2017, 1:29pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/10 "2017-12-21T13:29:36Z")

</div>

Same here. Literally Wallace Homestead uses this as a main feature for lighting, which ironically Epic are showcasing. Tried to be smart and compile using the latest build. Ouch! This is a killer feature, please promptly bring it back 😃

---

<div class="post-metadata">

**Author:** ![thesystemera](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thesystemera](https://forums.unrealengine.com/u/thesystemera)\
**Post date:** [December 21, 2017, 1:33pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/11 "2017-12-21T13:33:32Z")

</div>

Same here. Literally Wallace Homestead uses this as a main feature for lighting, which ironically Epic are showcasing. Tried to be smart and compile using the latest build. Ouch! This is a killer feature, please promptly bring it back 😃

---

<div class="post-metadata">

**Author:** ![thesystemera](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thesystemera](https://forums.unrealengine.com/u/thesystemera)\
**Post date:** [December 21, 2017, 2:21pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/12 "2017-12-21T14:21:55Z")

</div>

Is this method anymore expensive?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8c2d00e3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8c2d00e3](https://forums.unrealengine.com/u/anonymous_user_8c2d00e3)\
**Post date:** [January 17, 2018, 6:49pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/13 "2018-01-17T18:49:41Z")

</div>

seems very expensive.

---

<div class="post-metadata">

**Author:** ![Razvan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Razvan](https://forums.unrealengine.com/u/Razvan)\
**Post date:** [January 18, 2018, 1:05am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/14 "2018-01-18T01:05:00Z")

</div>

If this is expensive then maybe can be replaced with an animated texture like a gif or apng.

---

<div class="post-metadata">

**Author:** ![virtualHC](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtualhc/32/1194710_2.png) [@virtualHC](https://forums.unrealengine.com/u/virtualHC)\
**Post date:** [February 8, 2018, 5:15am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/15 "2018-02-08T05:15:05Z")

</div>

I ran into this same issue but in my case I’m trying to use depth data in a video for vertex displacement. I’m doing the suggested SceneCapture2D workaround but it’s not accurate. I hope this feature comes back in 4.19. Being able to use video textures for vertex manipulations is a very useful feature and removing it on capable platforms is a regression and limitation.

---

<div class="post-metadata">

**Author:** ![blurryroots](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blurryroots/32/490122_2.png) [@blurryroots](https://forums.unrealengine.com/u/blurryroots)\
**Post date:** [February 18, 2018, 4:45pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/16 "2018-02-18T16:45:50Z")

</div>

Another solution would be to use an intermediate rendertarget to render the media texture to. This rendertarget can then be sampled in the light function material. Not the cheapest solution, but quite easy to setup.

---

<div class="post-metadata">

**Author:** ![virtualHC](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/virtualhc/32/1194710_2.png) [@virtualHC](https://forums.unrealengine.com/u/virtualHC)\
**Post date:** [February 18, 2018, 10:00pm UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/17 "2018-02-18T22:00:19Z")

</div>

Thank you for the tip.Would this be cheaper than. SceneCapture2D?

---

<div class="post-metadata">

**Author:** ![Chris\_Phillips](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris\_Phillips](https://forums.unrealengine.com/u/Chris_Phillips)\
**Post date:** [February 22, 2018, 12:43am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/18 "2018-02-22T00:43:54Z")

</div>

Thanks for the report, zuthyrus! This has been fixed for 4.19 with CL 3902206. In 4.19 you will be able to sample media textures outside pixel shaders (i.e. lighting functions) with SM4 and up.

---

<div class="post-metadata">

**Author:** ![blurryroots](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blurryroots/32/490122_2.png) [@blurryroots](https://forums.unrealengine.com/u/blurryroots)\
**Post date:** [February 22, 2018, 11:33am UTC](https://forums.unrealengine.com/t/video-in-light-function-no-longer-working/410207/19 "2018-02-22T11:33:17Z")

</div>

I have not profiled it. My assumption would be, that since the scene capture approach involves a virtual camera only rendering a plane placed in the scene, there might be more steps involved to produce the final picture, instead of rendering directly to a render target.
