x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

split media texture into multiple parts for multiple screens

So here's in a nutshell what I am trying to do: Trying to achieve something similar to what New Retro Arcade:Neon have done with all their arcade screens. Except our screens are not arcade screens but just projector screens.

Steps I have taken to try and achieve this:

Step 1: Made a .mp4 file to have multiple videos in rows and columns.
Step 2: Made a material to show the video and placed material onto an actor (Just has a plane in the actor and it plays the video in the level)
Step 3: Trying to make screen 1 show top left video and screen 2 show second video and screen 3 show third video and so on.

BUT I dont know how to "cut" up the material so that it gets assigned to specific screens or even if I am going about it the right way.

Can someone help me please

Product Version: UE 4.19
Tags:
more ▼

asked Aug 11 '18 at 12:40 AM in Blueprint Scripting

avatar image

Snoxx
21 3 4

avatar image Tuerer Aug 11 '18 at 04:02 PM

If I understand it right, let's say you have your videos in 5 columns and 4 rows, so 5x4. In this case you should set your TexCoord in your material: Utiling: 0.2, Vtiling: 0.25 (1/5 and 1/4). Then you can change the desired parts by simply offsetting the texture.

avatar image Snoxx Aug 11 '18 at 04:38 PM

Any chance of explaining to me how I go about offsetting a texture on an object?

I managed to get only the top left video to play on an object but I just need to know how to go about making the 2nd video load onto a 2nd object and the 3rd video onto the 3rd object and so forth.

Thanks for your help.

avatar image Tuerer Aug 11 '18 at 04:58 PM

Sure. This is the example of a basic offsetable material as I have it. alt text Make sure U Offset and V Offset are parameters.
Create an instance of the material and apply it to your screens. You can use the same material for each of them, and offset the material individually for each screen on BeginPlay or on any other event to your liking. alt text Note that you will have to enter the parameter names manually (or copy/paste).
If you open the material instance and tick those two parameters, you can change them and see the result in your viewport right away, that might help you know how much you have to offset the material. Or you can just calculate it yourself.

offset-mat.png (129.2 kB)
offset.png (81.8 kB)
avatar image Snoxx Aug 11 '18 at 05:57 PM

I made my level blueprint like this but for some reason both actors with the plane are still showing the same video

alt text

and before you ask. yes both parameters are named to what the level blueprint parameters are set to.

avatar image Tuerer Aug 11 '18 at 06:24 PM

I think your problem is that your WhichScreen is connected to Sequence, and not to the ForEachLoop. This way the WhichScreen cannot get any screen index, or it just gets the default Zero and that's it. Try connecting it to the ForEachLoop maybe (after ADD)?

avatar image Tuerer Aug 11 '18 at 07:13 PM

Furthermore, it seems to me that this is a bit more complicated than it can be.
I can't get to understand the logic of this FIND of yours. If an index is in the library, you do not offset the texture (it's 0 and 0). If it's not, you offset the texture of the target that's not in the library, so the texture of nothing in fact. That's not going to work that way.
I'd try to connect WhichScreen to Switch on Int (or are those Floats? If so, you should really use Integers for Indexes instead). And depending on the Index, offset the texture on the target screen.
If you spend come time you can even create a formula to calculate the offset value automatically based on the index, this way all you have to do in future is assign the required index to a screen and your formula will offset the texture for you. Just a suggestion.

avatar image Tuerer Aug 11 '18 at 07:23 PM

Looked at it again. This way the 0.2 offset will never launch. If the Find result is false, the second branch activates and the Find result is still false, and the second branch launches nothing.
So in your case the texture is always offset by 0-0, so basically nothing happens.

avatar image Snoxx Aug 12 '18 at 02:42 AM

Hey Tuerer, thanks for the help btw :)

I changed the blueprint to what you suggested with the multiple actor references in the level blueprint and worked like a charm.

Thanks so much for the help :D

Now for the hard part. making the vlc media player plugin play the videos properly. At the start of the level when the videos are going through their first video cycle the screens are mostly black and sometimes pixelated and after the video loops it then plays properly.

Any idea as to why the video isnt just playing clearly from the start?

avatar image Tuerer Aug 12 '18 at 06:09 AM

Glad I could be of help.
Sadly, I haven't worked with videos yet, so I know nothing about that issue of yours. Might it be that the video sometimes doesn't have enough time to load properly at the beginning? Idk.

avatar image Snoxx Aug 12 '18 at 07:38 AM

yeah im not sure. It's just weird that it only loads properly after it's played once already

EDIT: I got it working :D at the start I put Delay > Rewind Media Player (with the media player variable plugged into rewind)

It makes the video restart from the start and then plays it clearly :D

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question