11

I was wondering how to make an emitting material that glows on the inside and has the edges darkened.

So far I've only achieved an inverted version of what I want by mixing Emission shader and Fresnel.

screenShot

  • You can connect the Emission shader to the Volume input socket of the Material Output node; that might give you some more options. See also this question: https://blender.stackexchange.com/questions/89440/make-object-emit-light-be-reconizable/89650 – lumpynose Mar 13 '18 at 20:30

1 Answers1

10

The disconnected Shader socket on the Mix node will be providing what is effectively a ‘black’ material. The Mix mixes between what is on the’top’ input with what is on the ‘bottom’ socket based on the Factor - with 0.0 and less giving the ‘top’ one on the output, 1.0 and above givinn the ‘bottom’ one on the output and values between 0.0 and 1.0 giving a mix between them. Therefore, to ‘invert’ your result you could either manipulate the Factor (eg, mathematically subtract it from one) or, alternatively, just swap te Shader inputs - so the emission is connected to the bottom one and the top one is unconnected.

Another option here is to add a Color Ramp between te Fresnel and Factor and you can then manipulate the ramp to change the effect.

using color ramp


EDIT : For a more controllable transition you could use vector maths and a Color Ramp as follows :

using dot product

Rich Sedman
  • 44,721
  • 2
  • 105
  • 222
  • this is definitely better. Thank you. I'll try to adjust it from here :) – Александр Литвицкий Mar 07 '18 at 16:15
  • just curious: where does the IOR of 16.6 come from? Did you choose it by trial an error (what looks best?) or did you calculate the value? – yann Mar 07 '18 at 16:20
  • You’re welcome. It was just a matter of adjusting it to get the best look - bringing it down from the value in your example. Using Fresnel in this way is not the best since it doesn’t give an intuitive 0.0 to 1.0 range. I think vector maths could produce better results (Dot Product) but that would be a more complicated solution. – Rich Sedman Mar 07 '18 at 16:23
  • 1
    Wow. Thanks for that vector solution. It's great! :) You've helped a lot. – Александр Литвицкий Mar 07 '18 at 17:04
  • This works well for a sphere but what happens with irregular geometry? – 3pointedit Mar 13 '18 at 20:45
  • 1
    @3pointedit Detecting the edges of an arbitrary mesh is a lot more complicated. One way would be to use an OSL volumetric shader to probe out the surrounding mesh such as in https://blender.stackexchange.com/a/89262/29586 – Rich Sedman Mar 13 '18 at 21:08
  • @RichSedman what is actually being calculated by the dot product of the normal and incoming vectors? – mattthew Sep 01 '18 at 02:52
  • 1
    @mattthew It’s essentially calculating the similarity of the directions of the normal at that point on the surface and the incoming ray - 1.0 will be where the incoming ray is perpendicular to the surface while 0.0 is a completely glancing ray. This is effectively the same as using a Fresnel or Layer Weight node (but allows you more control since you can adjust the calculation directly). – Rich Sedman Sep 01 '18 at 20:51