Crosshatching with Eevee

27.09.2018 @ Art(Blender, Eevee, Materials)

Blender 2.8 isn’t even Beta and it already has me hooked! Eevee will (IMHO) open the flood­gates for NPR and all kinds of cool styles. This time I worked on a cross hatch­ing mate­r­i­al.

The tech­nique is based on this paper from Princeton/Microsoft Research. The gist of it is mak­ing sev­er­al tex­tures to rep­re­sent the dif­fer­ent lev­els of shad­ing and map them to the light­ing in the object. Well, guess who has a shad­er-to-rgb node now? We can grab the illu­mi­na­tion data from a dif­fuse or glossy BSDF, plug into sev­er­al col­or­ramp nodes and get masks for each step. I changed one thing from the paper though. In the paper they use tex­tures that have the cross hatch­ing already com­bined and then mix them. I think keep­ing them sep­a­rat­ed and mul­ti­ply­ing them in a mix node is more efficient/flexible for Eevee.

I hope you like UV unwrap­ping :). You will need it to make the lines flow in a uni­form way. Oth­er tex­ture coor­di­nates can cause strange or unre­al­is­tic results. There is one excep­tion though. Large flat areas that are on graz­ing angles to the cam­era look weird, like a blurred mid-90s repeat­ing tex­ture. I haven’t found a good solu­tion yet. One way is to use the Win­dow tex­ture coor­di­nates. But these bring a dif­fer­ent prob­lem: they look awful the moment you move the cam­era and make the objects flat­ter.

Don’t for­get to scale UVs prop­er­ly to make the lines have rough­ly the same size. Also, since this effect depends on col­or­ramp-ing the dif­fuse shad­er it’s a lit­tle illu­mi­na­tion spe­cif­ic. Par­tic­u­lar­ly in high-con­trast places. You can see for your­self by mov­ing the sun in the blend file and watch­ing the effect on the shad­ows in the walls.

Sub­tle paper tex­tures real­ly help sell the effect. You can grab some at Pix­abay or Lost&Taken. Since the tex­tures are black and white you can take the ren­der and mul­ti­ply it on top of the tex­ture. Anoth­er impor­tant part of the effect is using masks and leav­ing emp­ty spaces to sug­gest details. Even more so if you are repeat­ing the tex­tures a lot, since the rep­e­ti­tion will look arti­fi­cial.

Speak­ing of tex­tures. They are very easy to make using Krita’s wrap mode (press w). Just grab a good brush and start mak­ing hor­i­zon­tal lines, then make anoth­er lay­er and make some more lines in oth­er places. Repeat to get three hor­i­zon­tal lay­ers. Then do the same for the three ver­ti­cals and export each lay­er as a sep­a­rate PNG file. For these tex­tures I used the ink-7-Brush Rough brush and drew the lines freehand.I also have anoth­er set of tex­tures I made with the Basic-5 brush and the line tool. These look more clean and orga­nized, but I kin­da like the rough look bet­ter. 

When mak­ing your own tex­tures keep in mind it’s impor­tant to keep the thick­ness and spac­ing of the strokes even. Oth­er­wise you can cre­ate local details that will show up when repeat­ing the tex­ture and ruin the effect. You can zoom out while in wrap mode to check this.

You can down­load the blend, tex­tures and the source kri­ta file. The whole thing is CC-0 so feel free to use it for any­thing with­out attri­bu­tion.
(I wouldn’t mind a link back though!)

All the posts you can read

4 Comments

  1. Iraito(5 months ago)

    Real­ly inter­est­ing, i will mess with it in the future, would you say that this tech­nique is good to get results sim­i­lar to this ? https://www.youtube.com/watch?v=-cw2gXq83n8

    1. januz(5 months ago)

      Hi! Yeah, you could mix those cross­hatch tex­tures into oth­ers to cre­ate a sim­i­lar effect to what they show on the 4:38 mark. For the out­lines you would have to use freestyle.

  2. Gareth(5 months ago)

    That sounds very inter­est­ing. Will look at the blend file. I won­der if we can replace the man­u­al tex­tures with algo­rith­mic tex­tures? This might make things a lot sim­pler, espe­cial­ly when it comes to UV unwrap­ping and scal­ing.

    1. januz(5 months ago)

      Hi, I think the only way to do some­thing like with pro­ce­du­rals would be using OSL or some cus­tom shad­er to gen­er­ate the whole tex­ture. You could pick ran­dom points and paint lines from them. The main prob­lem would how to dis­trib­ute those points in a ran­dom-but-still-reg­u­lar sort of way. Oth­er­wise you would have lines crum­pling togeth­er

Leave a Reply

Your email address will not be published.