I tried blurring the edges of my textured rectangle, doesn't appear to be working. Any tips?
blurAmt = 4;
surface.SetMaterial(self.Blur);
surface.SetDrawColor(255, 255, 255, 255);
for i = 1, 3 do
self.Blur:SetFloat("$blur", i * blurAmt);
self.Blur:Recompute();
render.UpdateScreenEffectTexture();
render.SetScissorRect(x, y, x + w, y + h, true);
surface.DrawTexturedRect(-px, -py, ScrW(), ScrH());
render.SetScissorRect(0, 0, 0, 0, false);
end;
surface.SetMaterial(self.MenuMaterial);
surface.SetDrawColor(255, 255, 255, 255);
surface.DrawTexturedRect(x, x, w, h);
Your draw order is wrong, if you want to blur the menu.
Draw your TexturedRect with self.MenuMaterial before you draw the blur.
That is true. however I've tried it both ways.
Can you take a picture of your result?
You might also need to increase the size of the blurred rectangle to be bigger than the menu, so that way the blurred edges aren't cut off.
Original code in the OP:
https://i.imgur.com/zDJtfFM.jpg
SetMaterial going before:
https://i.imgur.com/spW2skI.jpg
So, it basically doesn't change anything, how would I make it go further out?
bumpo
Sorry, you need to Log In to post a reply to this thread.