Cross Hatching

   3767   1   0
User Avatar
Member
1 posts
Joined: March 2014
Offline
Hi Experts,

Been trying to solve a school project for building a cross-hatching shaders using VOPMaterialBuilder. So far have been unsuccessful.

I've followed the formula online for creating GLSL cross-hatch shader but can't seem to make it work. Here is a link to the formula http://wesleygamedesigner.blogspot.co.nz/2013/04/cross-hatching-shader.html [wesleygamedesigner.blogspot.co.nz] from Wesley Chartrand's blog.

I've also attached my hip file, going through the network, it somewhat follows the construct of the simple formula. Alas, all I get is one black teapot.

Hope someone can advise.

Cheers,

Ariel

Attachments:
Sample_Cross_Hatch.hipnc (272.8 KB)

User Avatar
Member
606 posts
Joined: May 2007
Offline
Here you go. The main things I changed were the inputs. It needs to work in some sort of screen space coordinates instead of UVs, also I changed the shading to be an input instead of being fed by the pattern. Comparing with equality to zero is iffy in the rendering world. I changed the comparisons to smaller than an epsilon - you can use the epsilon value to control the width of the cross-hatching lines.

Attachments:
cross_hatch_ee.jpg (118.1 KB)
sample_cross_hatch_ee.hipnc (302.1 KB)

  • Quick Links