Dynamic Upscale/Downscale of the Screen?

Hi there. I’m trying to achieve something like a mosaic effect, basically would be dynamic downsample of the screen using a nearest-neighbor filter. Any idea how to do it?

I’ve researched and tried to get my head around ScreenTexture and Postprocessing but I don’t seem to nail it. So any help would be more than welcome.

I’ll leave this as an example in case I didn’t made it clear through words :slight_smile:

147a56991bbf7936c156fe5a9717b97626d3e1b4.jpeg

Thanks! Luke

There might be easier ways, but I would go about creating the formula in a material, and then use that as the postprocess material, at least that’s the way we implement it in UDK, but there shouldn’t be much change in this regard.

Hi ! Thanks for replying. Yes, I imagine that would work just fine, except for the part that I have no idea how to implement it. :confused:

I see, well implementation of which part you have a problem with, Using the material with PP or creating the actual material? And have you choose a particular algorithm for the downscaling itself?

Creating the material itself. I tried to use SceneTexture, and divide the Size output, but it clearly doesn’t work. I’m not quite experienced with Unreal to tell you the truth, I’m more on the artist asset creation side of the things. Any help with this would be really appreciated :slight_smile:

Thanks Farshad!

I think I have what you’re looking for. I just ported it over from my UDK project to UE4, here’s a quick video of it:

If this is what you need I’d be happy to share it :slight_smile:

It’s pretty straight forward actually. This is one way of going at it: (Click to view it in original size)

http://i.imgur.com/9C8hwcN.png

By changing the constant at the button in the red box, you can specify how much down you want it to to scale the screen’s resolution. This is what you get by “6 , 6”:

http://i.imgur.com/oLpwJKL.png

And the same view with “16 , 16”:

http://i.imgur.com/0p97w6N.png

Technically you can set the constant to any number you want, though integers dividable by 2 (or even better, 4) are preferred.

Also you can easily convert the constant to a parameter so you can control it in real-time if need be.


-Edit: , feel free to post yours too, if the setup is somehow different.

Seems like your version just about covers it, mine just adds in some more/other tweaks that I’ll show below. So if he wants it, I can share a video of setting it up, otherwise your setup is great :cool:. But yeah here’s what I mean by extra tweaks:

Wow guys

I just got back from work and found all this! It’s amazing! Thanks both of you! I think with Farshad’s shader I’ll be more than fine because that ‘pixelated’ effect it’s just what I need, but I loved the color sampling effect you made Wisdomcube! I’d love to see how you made it :smiley:

Thanks again guys!
Luke

Yeah I’ll do a quick video of it all for ya then. :slight_smile:

So everything was all peaches and cream, until I found out that SceneTexture is not available on Mobile, due to ES2 limitations. So I’m back to square 1 =/

I can’t think of another way of doing it without a material through a post processing effect. Any ideas?

Why didn’t you say you need this for mobile in the first post? lol

Sorry, I just slipped. I know I should said so in the first place. =/

It’s ok, though next time try to explain your situation with a bit more details.

I’m not an expert when it comes to mobile though, Most my games using UE where PC/Mac, and the ones that actually did target mobile, didn’t require any heavy post processing anyway. Might wanna wait for someone who actually used this on mobile to see if there’s a viable option for it.