Forum

Transparent Video in Stride

Hi there, I am working on an AR Project and would like to use stride this time.

One major feature I need is having a Transparent Video played on an geometrie like a plane.
At the moment I am loading a image stack of PNGs into the filetexture and select each image (30 fps) via index of an getSlice. It works for small videos, but there is no function for preloading the next images.

Than I try to get a nice looking result out of the transparent texture. The half transparent pixels are not transparent. I tried to use the blend (trancparency.MaterialAttribute) in the combination with the same texture for alpha. Doesn’t work.
Now I created a project in Stride. The material with the transparency of an image looks great, but how do I replace the Texture Image with a Video?

Looking forward to your thought on this topic and would be so grateful about help.

you could add a green background to your video instead of alpha and then use a chromakey tfx.

that way you could use e.g. vl.mediafoundation to play the videos

was thinging about it. How does the keying look like in the edges of the graphics? Isn’t in the half transparent area leftovers from the color?

try it out. you can tweak the edges with the chromakey parameters.

it depends on your usecase

There are codecs/containers that support alpha in video. For example VP9/webm.
Sample attached.

While the video plays nicely with alpha in firefox and chromium for example - either embedded in html or just the video-file - the alpha channel is ommited when played back using vl.mediafoundation. Just quickly skimming the code I couldn’t find any obvious reasons. Also a short search didn’t yield any answers concerning the support of alpha channel in videos in media foundation.
Maybe @elias can shed some light on this.

VL.Cef Webrenderer supports alpha in webm if the video is embedded in html. So if you don’t need much control over the video, e.g. just a loop, this could be an option.

WebmTest.7z (146.5 KB)

1 Like

Btw, latest preview has a mediocre help patch for keying with TextureFX.

Thank you so much for your help. Usually I am to shy to write in the Forum (Gamma is forcing me :/). Now I am so happy to learn from you.
I tried the Webm Version. could be I’m getting stucked with the same Problem. How to get a alpha Texture on a Stride model?

WebmTest.zip (151.1 KB)

I had a similar problem yesterday - maybe this could help?

Transperancy

mh. discourse seems to destroy gifs.
https://imgur.com/a/O7RG7KB

ahhh. Here we go. I didn’t turn the Cast Shadow off. Great !!! thank you so much!

I went a different way now. Using a black and white alpha Channel video to key out the alpha. Just need to sync the videos now. Is seeking the videos to a stopwatch a good idea in Gamma?

You can combine both videos in one, where you later grab the rgb part and the mask. You then also need only one player.

@sebl how can I combine the videos?

i think what sebl means is that you use your video editor to make one video where the image and the mask are combined. either side-by-side or over-under, much like 3d movies store the left and right eye. if you do that, your mask and the image can never run out of sync.

then you combine the mask with the image in a TextureFX to get the final video texture with alpha channel.

You also can use LumaKey or ChromaKey, if you video is on solid color background…

Ah, good idea to have two videos next to each other. thanks.
And I’ll try the chromakey at some stage, too. I just don’t want to have the hassle with keying out stuff by accident.

Thank you all so much for your support. Best community ever !!! : *