7
$\begingroup$

enter image description here

This image shows two of the same curve, one beveled into a cylinder, and one extruded into a flat plane. The material is a Diffuse mixed with glossy at .1 fac.

The top cylinder gets a strong highlight down its length and visible shadows at the glancing edges due to it's curve. The flat one's gloss is much more spread out due to it being flat.

What i want is to render shading like the flat strand, but on the cylinder. It seems this should be possible with some sort of normal changing or the like? I want the effect of the flat ribbon, but if I actually use flat ribbons then they disappear at certain angles, whereas the cylinder always has the same thickness.

If I were working directly with the mesh, then I'd scale it on the view axis till it was flat. Can something like this be done to the normals within the material?

UPDATE: Here's a picture showing the difference better. This is just the gloss, and I bent the bottom ribbon more to emphasize the difference. enter image description here The ribbon gets full lighting on it's whole surface because it is flat. The cylinder is less lit at glancing angles. I want to get the same sort of shading on the cylinder that I have on the ribbon. enter image description here This is gloss only with Incoming plugged into the normal socket. It is flattening things out, but has also fundamentally changed how the shading is working.

$\endgroup$
  • 2
    $\begingroup$ How about a shadeless material? (Specify your renderer btw) $\endgroup$ – Leander Aug 23 '17 at 20:00
  • $\begingroup$ @Leander shadeless is no good. I do want shading, just a specific sort. Note that the lower curve is not shadeless, it has just ended up looking all one color because it's normals all face in the same direction. $\endgroup$ – Drudge Aug 23 '17 at 20:02
  • 2
    $\begingroup$ Try plugging the Incoming value from an Input > Geometry node into the Normal input on the shaders. I think this is what you are going for but I'm not completely sure. $\endgroup$ – PGmath Aug 23 '17 at 20:38
  • $\begingroup$ @PGmath I have given that a try, but it does not produce the same effect. I don't know why, as I don't fully understand what Incoming is actually doing, and I can't find a detailed explanation either. $\endgroup$ – Drudge Aug 23 '17 at 21:33
  • $\begingroup$ Can you specify a little more what you're going for? I don't understand why you can't either 1.) use an emission shader or 2.) set roughness on Diffuse to 1.00. $\endgroup$ – bertmoog Aug 24 '17 at 1:46
7
+50
$\begingroup$

I believe you are after this shading effect:

enter image description here

It is possible with some vector math on normals. The goal is to change normals to be pointing towards camera, but the Incoming output from Geometry node will override all normals equally, ignoring in which direction the curve is heading. Luckily we can determine the local vector of the tube's direction:

Can I color a curve in Cycles by the direction it's running?

The rest is a matter of 2 vector cross products to get a vector incoming to camera but also orthogonal to the curve's direction:

enter image description here

If you want to do this on meshes, you will have to write your own OSL shader.

$\endgroup$
  • $\begingroup$ Yep, that's it! One question though: How could I use a normal map with that node setup? $\endgroup$ – Drudge Aug 29 '17 at 21:14
  • $\begingroup$ @Drudge technicaly with this math (check Andrew's answer): blender.stackexchange.com/questions/38298/…. The math in more detail is here: blog.selfshadow.com/publications/blending-in-detail. But the normal map details added to these vectors will be skewed towards the tube edges, that cannot be avoided. I am not sure if the result will be any good. $\endgroup$ – Jaroslav Jerryno Novotny Aug 29 '17 at 22:21
  • $\begingroup$ okay, that's working. Now I also want to get it working in a pretty strange usecase. I'm experimenting with the new Bevel Normal node (blenderartists.org/forum/…) and want to use this effect with it. However, that creates a whole new source of Normals (a modified version of the Geometry Normal output, but coming out of the Bevel node.) Any idea if I can use the two together somehow? Thanks! $\endgroup$ – Drudge Aug 30 '17 at 5:24
  • $\begingroup$ @Drudge You would have to get the difference of beveled normals minus ordinary normals, and add this to these flattened normals. Not sure again how it would look, it might produce artifacts. This beveled edges functionality is years far from usable though, so I wouldn't worry about it much. The whole way that Cycles works would have to change for it to be fast enough. $\endgroup$ – Jaroslav Jerryno Novotny Aug 30 '17 at 22:06
  • $\begingroup$ I guess that gets into some funky math then. It works pretty well right now. Low on options, but speed seems fine. Thanks! $\endgroup$ – Drudge Aug 31 '17 at 3:07
3
$\begingroup$

If you're using Cycles, try increasing the roughness of your glossy shader. If you're using BI, decrease the specular hardness. (This may not be what you want, but hopefully it'll help.)

Edit: From your second picture, it looks like you want an anisotropic shader. That way, you can control the glossy roughness independently for X/Y.
(This is for Cycles; if you're using BI try tangent shading.)

$\endgroup$
2
$\begingroup$

This is the kind of shader you might need for it, essentially light doesnt have shades and is a single color to be sure your environment isnt affected this light is only there if the lightray shines towards the camera. So you can still place it in a dark scene for example, without causing some red glow or so.

enter image description here

the effect : enter image description here

$\endgroup$
  • $\begingroup$ Shadeless in Cycles? Interesting. $\endgroup$ – SilverWolf Aug 29 '17 at 12:48
0
$\begingroup$

I think you gave yourself a really big clue.

"The top cylinder gets a strong highlight down its length and visible shadows at the glancing edges due to it's curve. The flat one's gloss is much more spread out due to it being flat."

When portraying reflective surfaces lighting is as much a factor as the material. Here's an example of what I think your node set up is with HDRi lighting.

enter image description here

Here's the reverse node set up with the same HDRi lighting.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.