Video textures with alpha

Dear Shapespark Team! I just wanted to bump up the subject of video textures with alpha channel - it would add so much possibilities to Shapespark to create lots of cool VFX. We are currently working on several non architectural projects in Shapespark and masked video texture would be incredibly useful!

@jan @wojtek

2 Likes

We have this feature in progress, but need some input from you.

Currently the video texture can have opacity smaller than 1.0, but this setting applies to the whole texture. Do you see practical use cases where you would like to set a different non-zero opacity but only for some areas of the texture?

We wonder if we should support a binary mode, where video pixels close to some selected color (blue, green or some other) are discarded. Or do we need some more advanced settings and shaders that would allow to modify opacity of some pixels based on their color. So, for example, you will have a texture with some pixels with opacity 1.0, some with 0.7, and some with 0.0.

2 Likes

@jan I definitely can see cases where semitransparent video could be used - like fire and smoke but also some specific visual effects. Currently we are investigating possibility to show animated air flow and some gradient to gradually fade “ends” of the flow would make much sense. From my point of view it would be most convenient to adapt popular option in vfx that the material just has additional opacity channel that can by controlled by a grayscale texture.

1 Like

It would make sense to select a color (black, green, blue, white) for VFX footage like fire or smoke, and set this color to opacity 0.
If you can provide further options they are always welcome. I think that currently there are so many cases Shapespark can be used for that it is hard to tell right now what is needed in the (near) future.

2 Likes

If you already have videos that you would like to use with this feature, we would be grateful for sharing them for testing purposes (on the forum or via team@shapespark.com).

1 Like

The new release with this feature is available . There are two modes that can be configure in the Material tab under Base color settings:

  • Chroma key: allows to select a color that is treated as transparent with configurable deltas.
  • Alpha in lower half: allows to upload videos where upper half is used for normal color data and lower half for opacity.

The first mode works well for things like fire effect with black background. It doesn’t work perfectly for green-screen videos. In our tests in such videos there often is some greenish color leaking at borders of opaque parts. We experimented with several algorithms, but none of them was fully able to remove the greenish color without also removing some areas of the tested videos that should be kept.

The second mode allows to fully control what should be removed and doesn’t have problems of the first mode. The drawback is that videos require additional work to prepare and are larger in size. See also this post for the description of this technique and format.

5 Likes

Amazon news! Thank you @jan!

Good news! Very good implementation. I hope they evaluate the possibility of being able to use youtube videos as a texture. (streamings). It is something that they are asking for a lot in these times. Thank you!

1 Like

To use YouTube videos as textures, YouTube would need to enable such usage. At this moment YouTube allows to embed videos as iframe elements, but not as HTML Video elements. The seconds option is required to use a video as a texture.

@jan Do you know other video hosting websites that allow video as HTML elements?

This article tells how do it, is it correct? Can we used as they mention?

If I understood this article well, the video can be on your web server (for example), where your website is hosted. If not, @jan please correct me.

Two formats are listed, due to the adaptation to the devices on which it will be played.

  <source src=”http://techslides.com/demos/sample-videos/small.ogv” type=video/ogg>
  <source src="/build/videos/arcnet.io(7-sec).mp4" type=video/mp4>

Note: Website hosting servers offer different pricing packages based on site traffic.

1 Like

YouTube won’t do something that doesn’t make money (display ads).
However, there is an api in the Unity store.

Certainly, I am familiar with your efforts in the integration of m3u8, but this is also worth mentioning, it may be useful someday.