10
$\begingroup$

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

$\endgroup$
9
$\begingroup$

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

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

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.