Adding CRT off animation to a model?

Hey all, I recently started with recreating a stage seen in Smash Bros for Wii U, and my brother created a model to accompany it. But I have a bit of a problem with an animated texture I made, which is a CRT off animation

http://kittehcat.org/upl/2015-05-21-1558-49.mp4

As you can see, the texture is already halfway through the animation once it’s drawn. I noticed that the texture is always playing, and looping even when it’s not drawn.

Simply put, I’m trying to achieve the same animation as shown here:

I was taking a look at Hammer’s animation options, and I have much better control over the timing of an animation there, rather than doing it this way.

So now I have been thinking, is it possible to add an animation to the model, and put a brush with a white selflit texture on it which shrinks overtime to match this animation?
I asked my brother about it, but he didn’t know a way to do it yet, so I wanted to ask away here.

Thanks for reading this!

Anyone? Or is what I’m asking simply impossible in Source?

There’s probably a handful of ways to emulate the effect without using an animated texture.

Flashing each frame as an individual model for example. Or alternatively carefully crafting an animation using bones alone.

Another way is to use VMT Proxies to transform/rotate a texture on a given model. In your case, you can try using a combination of TextureTransform and an Exponential, Sine, or Linear Variable to simulate the screen “caving inwards”, as well as using UniformNoise or GaussianNose commands to simulate the noisy effect as the screen turns off.

This also takes up considerable less space on one’s hard drive, but it’s a little annoying to be able to get everything working properly.

There is a entity in hammer that deals with modifying a material, its material_modify_control. On the ValveSDK

I would get the animated texture’s vmt and add this as a Proxy first.



Proxies // proxies are listed inside this block
	{
		 MaterialModifyAnimated
		{
		}
	}


I assume you would remove any of the previous code in the vmt for animations as the material_modify_control will handle it all for you.

When you want to trigger the effect I would send the material_modify_control a input of


StartAnimSequence FrameStart FrameEnd FPS Loop

Which would end up being something like this in hammer,

0 -1 30 0

Which tells the entity that it starts on frame 0, ends on the last frame, sets the framerate to 30 fps (change it depending on what you have your desired framerate be) and to not loop.

I assume you understand the basics of I/O so you can fill in the rest of the keyvalues on the material_modify_control, though Material Variable to Modify should be left blank.

I should also tell you that this is all theory, but should work anyways. Tell me how this works out for you

Thanks for the replies, although right now I’m having trouble deciding if I should keep the current one, or create one from scratch. I can’t tell if it looks good or not. What would one of you guys don’t my situation here?

On another note, currently trying out the point entity, and I guess these parameters are correct?

http://kittehcat.org/upl/Object_Properties_tv_SMPTEbars_-_logic_relay_2015-05-24_00-15-54.png

Edit: Gave this a spin ingame, but I get the following error in the console:


Error: Material "vsh_gamer/room/tv_screenoff" : proxy "MaterialModifyAnimated" unable to initialize!
K

My guess is I messed something up in the VMT?


"UnlitGeneric"
{
	"$basetexture" "vsh_gamer/room/tv_screenoff"
	"$selfillum" 1
Proxies // proxies are listed inside this block
	{
		 MaterialModifyAnimated
		{
		}
	}


}

I wonder if this has to deal with TF2,

I will try to recreate it in hl2 to see if I get the same error, but for the sake of trouble shooting reformat the vmt to



"VertexlitGeneric"
{
	"$basetexture" "vsh_gamer/room/tv_screenoff"
	"$selfillum" 1
	"Proxies"
	{
		"MaterialModifyAnimated"
		{
		}
	}
}


Also if you don’t mind providing, are you applying this material to a brush, or a model. If its a brush then you should change vertexlitgeneric to lightmappedgeneric, or unlitgeneric with the “$selfillum” 1 removed.

Also if its a brush, best I can tell the brush must be a entity of some kind.

Sorry, forgot to add that.
This is applied to a model, and once the texture is supposed to show up, I switch the skin to the appropriate one.

http://kittehcat.org/upl/2015-05-24_09-38-55.png

It does show up, but the animation doesn’t play by the error shown in the console and stays on the first frame until it switches to skin 0.

Tried the edited VMT as well, and I get the same error once again. Really annoying it doesn’t show any more information than this.