ScreenSpace Halftone Filter

Greetings!
I’m working on a halftone shader (atm it’s not quite good as expected)
b95ef187a14debed0805dd6db51caca9c2452fd4.png


*RenderTarget Size node is equal to Buffer Resolution output of ScreenResolution node
I have 2 main problems:

  • How to apply Post effect before AA (because otherwise it make image ‘layered’ - banding appears)
  • How to scale luminance properly?

I have no idea how this works. I love it.

There’s a setting in the material details that may help:

Capture.PNG

I’m not sure if that will actually help, but it may point you in the right direction. If it’s possible, try changing the priority. I’m 90% sure all post-processing happens after the base post processing pass, but you never know.
Actually, maybe this will help:

try changing your sample texture from PostProcessInput0 (which is after the AA) to Base Colour or Diffuse Colour. I’m pretty sure those happen before AA :slight_smile:

As for scaling luminance, I don’t even know what that means (I am not smart). If you’re wanting to change the bias at which the HalfTone swaps between black and white, that’s the scalar value you currently have set to 0.1 in the ‘b’ input of the if statement. setting that to 0.5 would be a ‘balanced’ halftone.
if you’re trying to avoid the eye adaptation for the halftone, then setting the first screenshot to ‘before tonemapping’ would help a lot.

Base Colour or Diffuse Colour is a properties of objects, they are not respect lighting.
Blendable Priority is used in case of multiple post shader effects, I have only one.

So far I’ve managed to improve result by adding Screen Percentage (200) and increasing size of dots 2 times (that make them same size after scaling down) that also requires AA to be switched to FXAA.

Added a gamma correction (to make brightness more linear)


Still has some minor issues.

Awesome effect!
One thing you could do to improve to accuracy of the reproduction would be to actually sample the scene texture at the lower resolution of the halftone pattern. It looks great but you can also tell that it is kind of rendering on top of the scene when you look at the thin dark shadow details. In real halftones those areas look more like a cluster of the random sphere sizes straddling the border.

One way to do this would be to sample using the ‘mosaicUVs’ function (look in engine content in content browser for some reason that one wasn’t exposed to the search library) where the mosaic size matches the number of dots. The trick to making it work seamlessly is that you will have to get the value of the neighbor pixel cells and also include their distance calculation so they can blend seamlessly. It will be a bit more expensive, about as expensive as an outline post process.


I’ve changed shader almost completely.
Need some tweaks with exposure.

  1. No more banding
  2. Circles could be very small
    @RyanB Yep, I thought about lowering the resolution of the render to remove this “rendering on top of the scene” effect.

oooh pretty :smiley: any chance of sharing the reworked material? I’ve been playing around with the effect myself and managed some nice results:

before:

After:

and there are obvious places where it could be improved. i think i messed up some contrast areas, like the values are too uniform until you get to the extremes.

@Construc_
Yep I’ll publish a shader. I just need time to finish it. And it’s too big now to put it on screenshot (but still fast), so today I need time to sleep. -_-


53ca354e5c7990d39b877411412d8a2dbb4608d7.png
Ok. Almost done. Hope today I’ll finish it.
Pixelization gives one not very good effect IMO - Aliased Edges.

That is looking pretty sweet!

Still has one thing to fix, not sure if I will (may impact performance).
Working on Examples project.

A charming effect! I hope to see something made using it someday.

I’ve totally forgot to publish those assets.

A reference to original author would be really appreciated mr. Peter Ankermann…
http://darknesz.artstation.com/projects/VaD8X

I would be really happy if you would release this halftone post process material :slight_smile:
I’m trying to achieve something similar but I have no luck…