# Emission shader that glows on the center of the object and is dark on the edges

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.

## 1 Answer

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.

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

• this is definitely better. Thank you. I'll try to adjust it from here :) – Александр Литвицкий Mar 7 '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 7 '18 at 16:20
• Wow. Thanks for that vector solution. It's great! :) You've helped a lot. – Александр Литвицкий Mar 7 '18 at 17:04
• @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 blender.stackexchange.com/a/89262/29586 – Rich Sedman Mar 13 '18 at 21:08
• @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 1 '18 at 20:51