NekoToonDocs Download

Advanced

Parallax

Parallax fakes depth on a flat surface. A height map shifts the texture coordinates depending on the viewing angle, so recessed areas appear to sit behind raised ones without adding any geometry. Typical uses are eyes (an iris that sits deeper than the cornea), engraved patterns and panel lines.

The shift is applied to the main UV and to UV0 before the Main Color is sampled, so the main texture and every other texture that reads UV0 (normal maps, masks and so on) move together. Textures that use UV1–UV3, MatCaps and the outline are not shifted.

Parallax#

Parallax#

_UseParallax on / off · default off

Turns the parallax effect on. The remaining settings appear once it is enabled.

Parallax (texture and scale)#

_ParallaxMap texture · default gray _Parallax float · default 0.02

The height map and the strength of the effect, on one row. Only the red channel of the texture is read (the tooltip says Parallax (R)): bright means raised, dark means recessed. The number next to the texture is the depth scale. Small values such as 0.01–0.05 look natural; larger values exaggerate the depth and make the texture smear at grazing angles.

Offset#

_ParallaxOffset float · default 0.5

The height value that counts as "on the surface". Pixels whose height equals this value do not move; brighter pixels shift one way and darker pixels the other. With the default 0.5, mid gray stays in place. Set it to 1 to keep white areas fixed and push everything darker inward, or to 0 to keep black fixed.

[high-load] POM#

_UsePOM on / off · default off

Switches from simple parallax offset to parallax occlusion mapping. Instead of a single shift, the shader marches a ray through the height map until it hits the surface, which gives correct occlusion (raised parts hide what is behind them) and much more convincing depth. The number of steps per pixel grows with the scale (400 × _Parallax, so 8 steps at the default 0.02 and 40 at 0.1), which makes it noticeably more expensive.

POM samples the height map many times for every pixel of the material. Keep the scale low and use it only on small areas such as the eyes. Simple parallax (POM off) costs one extra texture read.

NekoToon removes unused features from the shader when you build an avatar. Parallax and POM are kept when a material has them turned on, or when an animation clip on the avatar animates _UseParallax / _UsePOM.

NekoToon is a fork of lilToon by lilxyzw (MIT License). Fur styles are based on Xiexe's Unity Shaders (MIT). NekoToon and its documentation are made by Mora for 404NyanFound.