Hello my fellow nerdy polycounters,
I want to share a quick function i just added in a material of mine that enables you to sample a texture of your choosing and apply a blur to it. The code is similar to a guassan blur, except less expensive (relatively).
The total function unfortunately costs a whopping 24 extra instructions =(.
Anyways, i just thought it would be cool to share it, because it is applicable to cube maps and reflection maps, and it may help you get a cool look that you're going for in your UDK renders.
The way it works is pretty simple, you have to make 9 duplicates of your texture parameter, and offset each one of the UVs by -1, and 1 on the X and Y coordinates. so you have a matrix of 9 coordinates, including 0.
then you add all the samples together and divide by 9, and you get your blur.
the number yo offset the UVs by is the "Radius" or the parameter i'm playing with in the screenshots. it should change depending on the size of the texture you are using.
Network -
In Game =
Let me know what fellers think
Replies
If i were to use 3 different mix maps to jitter the texture, then just average out those samples, it would save a butload of instructions, while still giving a (pretty decent?) blur.
this is something i'm going to have to try!
nice stuff
I'm glad someone caught that reference.
with the solution above i think it's only possible to blur everything and then mix between the two textures? also above 1 pixel it seems to only take 1 sample and looks more like an offset picture rather than a blur
The irony is, the more useful texture for this feature (like Cubemaps and Normal Maps) cannot use the custom node without breaking. Normals break around the tangents (so you cannot use the Mip/Blur technique for SSS) and Cubemaps are only read out as 2D instead of 3D textures.
So close, yet so far.
I built a realtime controllable bilinear filtering material function to solve this very problem. It still has some artifacting here and there at the more blurry settings, but it is controllable at a per pixel level. Also it kinda works like a supersampler with a sample number higher than the pixel resolution of the image.
here: Material function package is updated. Has some examples and some new stuff. Still no working cubemap blur, but the bilinear filtering mat function is working just fine. There's an example material in there for how to use a greyscale map as a control texture for selective blur via the bilinear filter.
Download this
I've looked at every node in the editor and no name pops out as being the one I need. Tried it old school with a panner node at the X speed to the offset and hooked a constant with a value of zero into the time of the panner but that doesn't do it. Doesn't shift at all.