CMYK Halftone

CMYK Halftone‘ is a NPR effect for Unity which simulates the reprographic technique Halftone.





Use ‘CMYK Halftone‘ is easy. Select the camera you’re going to use (usually called ‘Main Camera‘) in the ‘Hierarchy‘ editor window (1), then click on ‘Add Component‘ button in the ‘Inspector‘ window (2).


Now you can select the effect in two different ways. The first way is using the search field and write ‘CMYK Halftone‘, then select the effect.


When you add it you will see something like:



In the first zone (1) you can change the strength of the effect. You can also change ‘Mode‘ between ‘Screen, ‘Layerand ‘Distance. Later we will see how they work. You can also control how the effect is mixed with the original image.


In the second zone (2) you can modify the effect parameters.

The ‘Color’ (3)  area is used to modify color parameters and you must activate it (in the small circle near the label) to be able to use it. In ‘Advanced settings’ (4) you can adjust the ‘Depth threshold‘ parameter to adjust the sensitivity in the layers mode.


Pressing at ‘[doc]’ (5) will go to the online help and in the ‘Reset‘ (6) button some parameters will return to their default values.


I said that there are four different modes. The first one is ‘Screen‘ and is the one used by default. It makes the effect apply to the whole screen. Another mode is ‘Layer‘ and with it you can apply the effect only to the layers you want.

With ‘Distance‘ mode you can select the depth curve to modulate the effects strength. The range starts at the ‘Near‘ distance of the camera and ends at ‘Far‘. If you see any accuracy faults, you can adjust the sensitivity with ‘Depth threshold‘ at ‘Advanced settings.

Layer‘, and ‘Distance‘ modes add a depth texture to the camera, and may not be available on some mobile platforms. You should also keep in mind that both modes depend on the ‘Far‘ parameter of your camera. If you use a ‘Far‘ too large (default is 1000), you may have precision problems, so I advise you to reduce it as much as possible.



The effect supports virtual reality devices (VR), but at the moment, only ‘Screen‘ mode does work in VR mode.



All code is inside the namespace ‘Ibuprogames.CMYKHalftoneAsset‘ and the main component is ‘CMYKHalftone‘. So if you want to use it you must first import its namespace:


using Ibuprogames.CMYKHalftoneAsset;

If ‘myCamera‘ is a valid camera and you want to add the effect, you should do something like:

CMYKHalftone cmyk = mycamera.gameObject.AddComponen<CMYKHalftone>();

All the code are well commented, I recommend reading the code if you want more information.


Any questions or suggestions you have, we will be happy to answer you in our mail:


You Might Also Like

No Comments

Leave a Reply