Working with blurscreen

Hi All,

New to blur, and materials in general. Not sure what I’ve done wrong. What I’m getting is in the picture below ( any pointers would be great ):

	SB.VGUI.HeaderContainer.Paint = function()
		local blurTex = Material( "pp/blurscreen" )
		surface.SetMaterial( blurTex )	
		surface.SetDrawColor( 255, 255, 255, 255 )	
		blurTex:SetFloat( "$blur", 3 )
		surface.DrawTexturedRect( 0, 0, SB.VGUI.HeaderContainer:GetWide(), SB.VGUI.HeaderContainer:GetTall() )

I think you have to set the float up gradually or something like that (since that’s what gmod seems to do)

Also, you probably shouldn’t be creating an IMaterial in a paint function

Sorry, it was outside the paint function, I just put it there to test something :stuck_out_tongue:

And oh, I can try setting it gradually.

What exactly do you want to achive?

I’ve got it now thanks Whitestar - Neth helped out. I was just wondering why my blur was appearing as above, which I now have fixed. Thanks.