Video in Light Function no longer working

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

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)

I added UE-52612 to track this.

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?

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).

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!

Same problem here, this is frustrating

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.

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

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 :smiley:

Is this method anymore expensive?

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 :smiley:

seems very expensive.

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

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.

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.

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

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.

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.