Source Filmmaker

Source Filmmaker

Wowbagger Jun 19, 2015 @ 11:04am
Displaying video on a TV screen ingame?
Okay, so, the project I'm working on requires a video to be playing on a TV in a specific scene. I have a tv model from the workshop that uses RT cameras, and I know how to use that, so I can make, say, a security camera setup, but how would I get it to actually show a video from outside SFM?
I'm sure it's possible, but I can't think how to do it, short of just making the TV's screen green and just chromakeying the video in Sony Vegas, but that's kinda awkard and not ideal. Any ideas?

Cheers.
< >
Showing 1-9 of 9 comments
Zappy Jun 19, 2015 @ 11:06am 
Simply convert a video into an animated VTF, making sure not to go over the file-size limit causing pink-and-black error checkers, and also make a (44100, 22050, or 11025 hertz) Wave sound of the video if you want, then use override materials to set the string $BaseTexture to the VTF, and make a float called $Frame, then create an animationset for the material, and animate the $Frame value.
Wowbagger Jun 19, 2015 @ 11:13am 
Originally posted by Vintage:
Simply convert a video into an animated VTF, making sure not to go over the file-size limit causing pink-and-black error checkers, and also make a (44100, 22050, or 11025 hertz) Wave sound of the video if you want, then use override materials to set the string $BaseTexture to the VTF, and make a float called $Frame, then create an animationset for the material, and animate the $Frame value.
That's perfect, thanks very much. I'm still a little iffy with override materials, so I wasn't sure how much could be done with them, that sounds ideal for what I want to do, though, thanks for the help.
Zappy Jun 19, 2015 @ 11:17am 
I'd advise using the DXT1 format at 128x128 or 64x64 while only converting it at 10 frames per second (if at all applicable), since Source can some times be very iffy with texture file-size.

DXT1 fills less than DXT5, by the way.
Chara Jun 19, 2015 @ 1:03pm 
Originally posted by Vintage:
Simply convert a video into an animated VTF, making sure not to go over the file-size limit causing pink-and-black error checkers, and also make a (44100, 22050, or 11025 hertz) Wave sound of the video if you want, then use override materials to set the string $BaseTexture to the VTF, and make a float called $Frame, then create an animationset for the material, and animate the $Frame value.

That's not simple at all ;-;
Zappy Jun 19, 2015 @ 1:04pm 
Theoretically? Nope. In practice? Very.
Mukwa Jul 5, 2018 @ 8:05pm 
Originally posted by Zappy:
Simply convert a video into an animated VTF, making sure not to go over the file-size limit causing pink-and-black error checkers, and also make a (44100, 22050, or 11025 hertz) Wave sound of the video if you want, then use override materials to set the string $BaseTexture to the VTF, and make a float called $Frame, then create an animationset for the material, and animate the $Frame value.
how might i be able to animate the $Frame value? i get a popup that says "$Frame" and i see a Min/Max number
Zappy Jul 6, 2018 @ 1:07am 
Originally posted by xanderb730:
how might i be able to animate the $Frame value? i get a popup that says "$Frame" and i see a Min/Max number
Set the minimum value to 0, the maximum value to either 1 or (the amount of frames in the VTF, optionally minus 1 or minus 0.00001), then animate the resulting slider, and then create the animation set for it.

You should now get a new animation set in the Animation Set Editor, letting you animate a slider for $Frame. (If you don't, you may have to click the cog/gear icon at the top-right of the Animation Set Editor and hide "scene hierarchies".)



If you set the maximum value of the slider to (the amount of frames in the VTF minus 1), the left position of the slider should be at the start of the first frame, the right position of the slider should be at the start of the last frame, and everything in between should correspond to all frames but the last one.
For example, with 3 frames and the maximum value set to 2, the left half of the slider will be the first frame, the right half of the slider will be the second frame, and the very right edge of the slider will be the third/last frame.

If you set the maximum value of the slider to (the amount of frames in the VTF minus 0.00001), each frame should have (basically) the same amount of space on the slider.
For example, with 3 frames and the maximum value set to 2.99999, the first third of the slider will be the first frame, the second/middle third of the slider will be the second frame, and the third/last third of the slider will be the third/last frame.

If you set the maximum value of the slider to (the amount of frames in the VTF), it's basically the same as above, except that every frame will now actually have truly equally much space on the slider (not accounting for floating point precision), but the very right edge of the slider will now show blackness due to trying to show a non-existant extra frame.
For example, with 3 frames and the maximum value set to 3, the example is the same as above, except that the very right edge of the slider will try to show frame 4 out of 3, which doesn't exist, resulting in just showing blackness instead.

If you set the maximum value of the slider to 1, a slider value of 0.0 to ~0.99999 will correspond to the first frame, a slider value of 1.0 to ~1.99999 will correspond to the second frame, and so on. (In the other examples, the very right edge of the slider was still slider value 1.0, there's just some multiplication going on from the slider value to the value sent to $Frame.)
This, however, means that it won't be as easy to animate it in the Motion Editor (as you can't input more than 1.0 into the slider), but you can easily add a keyframe in the Graph Editor, select that keyframe, and put a custom value (even above 1.0) into it in the Graph Editor.



I would personally recommend using either (the amount of frames in the VTF minus 0.00001) or 1 as the maximum value of the $Frame slider, though I'd only recommend the latter if you know what it means/how it works.
Mukwa Jul 6, 2018 @ 12:51pm 
this is helpful. do you reccomend any models to put this on?
Zappy Jul 6, 2018 @ 1:01pm 
Originally posted by xanderb730:
this is helpful. do you reccomend any models to put this on?
No, I don't.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Jun 19, 2015 @ 11:04am
Posts: 9