Jump to content

Emulating Toon Cross Hatching?


Recommended Posts

Hi All,

 

I ran across this page where Ryan Hurd uses a custom VEX shader to accomplish cross hatch shading.

http://hurdfx.blogspot.fr/2005/05/vex-toon-cross-hatch.html

hatchOld.png

 

I am trying to replicate this effect but I can't seem to figure it out. The above website describes the technique but leaves out a step-by-step which noobies like me still need.

 

Can someone take a look at my HIP file and tell me what I have done wrong or still need to do to create this render effect? I am not sure if it is a shading issue, lighting or both? I have re-constructed the shader as best possible, it is located in the SHOP network.

ap_vex_cartoon_hatch_marks.hipnc

post-12295-0-53598900-1428167283_thumb.p

Link to comment
Share on other sites

Lot of problem in your file:

 

- In your shader, make sure your input bind nodes are matching what they should bring in: both uv and Cd are set as float while they should be vector.
- Default Cd is set as 0 (black) and there is no Cd attribute on your geo.
That means you nullify all your shader output on multiply1 by this black value (anything times 0 will be 0 = black)
--> Add some colours on your geo or change the Vector default on bind2
- Change your Tube and Sphere from Primitives to Polygon if you want to have the wireframe effect.
- Your ramp2 (wire) is set as a RGB ramp while you want a Spline Ramp (float) as it is meant to reshape your incoming value (luminance) to control the wire width.
- The Outline curve should be reversed as you want white inside and black outside. If not you are facing the same issue that earlier: you multiply everything by black except the outlines.

 

To debug, just plug the output Cf to anywhere in the network and see what render, it'll make more sense.

Edited by iamyog
Link to comment
Share on other sites

I just opened your scene and reduced the wire ramp values. This is what renders : (H14.0.132)

post-10914-0-32522600-1428923187_thumb.p

 

Not sure what's missing in yours. Plug the output of wireframe1 into Cf and play with your ramp values until you see something maybe? Check your Normals/uv values as they are needed for wireframe1 to work.

If you dive inside it, you'll see that a boxesSOP is responsible for the wireframe effect so make sure it is feeded with proper things.

Link to comment
Share on other sites

here is slightly different approach. I inserted stripes in the dark areas only of the shader(made them white so they are easier to spot) but what I can't get to work is how to rotate the stripes? they run from top to bottom or bottom to top of sphere. is there anyway by which they are angled at 45 degrees on sphere?

stripes_shader.hip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...