7
$\begingroup$

Using Cycles, for a cartoony animation character I need spikes to be seen only from the character's edges and behind the character but never seen in facing angles. I want to avoid having to render the scene twice to be composited after.

For example: 2 meshes, 1 skin color, smooth, rigged, 1 blue spiky mesh sticking out, rigged, never seen in front.

I have no idea how to accomplish this.

Do I have to account for camera angle and normals of the spike's base?

Can I just layer one over the other with nodes?

Default look:

enter image description here

Approximate Desired result done in Photoshop.

enter image description here

$\endgroup$
2
  • $\begingroup$ you have to use compositing. I can make an answer when I got time. $\endgroup$
    – HenrikD
    Commented Feb 2, 2021 at 8:00
  • $\begingroup$ @HenrikD Your confidence is welcomed. I await patiently your solution. $\endgroup$ Commented Feb 2, 2021 at 8:04

2 Answers 2

8
$\begingroup$

This seems like a task for the compositor, but you explicitly stated that you don't want to render multiple times. That means only AOVs remain an option for compositing. After trying it I discarded the idea, because it will cause artifacts. Instead I found a solution using only the shader and some Custom Normals.

First you need to redo the spikes. You need a spike geometry with Custom Normals pointing along the spike direction. You can do that in Editmode of the spike by using Mesh > Normals > Point to Target or using Alt+L. Then you can use instancing to put the spikes at the vertices of your model. Then you need to disable ray visibility for any other ray than a camera ray in the object settings of your spikes.

After this setup you can make this shader: shader setup with basic toon shader

The result looks like this: enter image description here

You are also free to change your material in any way you want, which could have been difficult with the compositor approach.

Here is the Blend File:

$\endgroup$
3
  • 1
    $\begingroup$ Magnificent! Never once did I ever say to myself "ya know what this shader needs? Dot Product!" See this is why I need an expert to get such a thing done. Thanks a bunch. $\endgroup$ Commented Feb 2, 2021 at 9:37
  • $\begingroup$ How do I not have the spikes pop up at every vertex? Can I use a vertex group to control the layout of the spikes? If so what do I need to to change for that to work? $\endgroup$ Commented Feb 2, 2021 at 10:10
  • $\begingroup$ OK I figured it out. I just delete the mesh where I don't want it. Well I'm gonna have some fun now using this. $\endgroup$ Commented Feb 2, 2021 at 10:31
2
$\begingroup$

The closest I got was using cones with inverted normals and backface culling enabled:

result

But as you can see, cones pointing slightly towards the camera still get shown.

$\endgroup$
2
  • $\begingroup$ That is pretty good, maybe if instead of cones maybe an image plane of a cone? $\endgroup$ Commented Feb 2, 2021 at 8:01
  • $\begingroup$ This effect only works because of the cone geometry, so an image wouldn't suffice. $\endgroup$
    – Jummit
    Commented Feb 2, 2021 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .