4
$\begingroup$

enter image description here

This is my node setup and the type of output I desire. However, this works well if the shape used is a sphere. I want to apply this same effect on an elongated sphere (some close to the shape of a rice grain) evenly. How do I go about it without increasing the geometry of the scene?

$\endgroup$
3
  • 3
    $\begingroup$ Can you post a picture of what happens when you try it with an elongated sphere? I'm not sure I understand exactly what the problem is. $\endgroup$ – Scott Milner Sep 21 '17 at 23:14
  • 2
    $\begingroup$ Adjust the X,Y and Z scale values of the Vector Transform Node accordingly so the gradient is correspondingly elongated too. $\endgroup$ – Duarte Farrajota Ramos Sep 21 '17 at 23:14
  • $\begingroup$ Change the mapping type to texture and scale one axis to match the elongation. $\endgroup$ – sambler Sep 22 '17 at 6:34
5
$\begingroup$

You can achieve a similar effect using the OSL shader developed for this (Distance from the surface as an input node for use with volumetric materials) answer.

Here is the material node set up :

material

Note that I've swapped the IOR for the Glass shader compared to your answer. I believe you must have flipped your normals to get the effect in your example image - adjusting the IOR produces the same effect for refraction.

This produces the following result :

result

Adjust the Multiply node and the Emission strength to adjust the glow.

EDIT : You can adjust the prominence of the glass by either reducing the IOR further (although depending on the look you're looking for this might be undesirable - the refraction might look 'odd' since low IORs don't exist in the real world) or by adjusting where the 'glow' starts - either by adjusting the Color Ramp to increase the 'black' region or by adding a Subtract node to shift the start of the glowing region away from the boundary. I've updated the material to include the Subtract node (and have removed the unnecessary Mix shader).

Here's an example with decreased IOR and increased gap between the glass and the glow.

example2

$\endgroup$
6
  • $\begingroup$ ok, that solved it, but 1) what does the mix shader node do? 2) is there any way to have the glass layer look more obvious/noticeable from a distance? $\endgroup$ – Tejas Sep 22 '17 at 18:53
  • $\begingroup$ Also, what does that "iterations" counter do in the OSL node? $\endgroup$ – Tejas Sep 22 '17 at 18:59
  • $\begingroup$ Apologies for the Mix shader - that shouldn't have been there and was left over from mixing in other nodes to try and get the desired effect. I've updated the material to remove it and also added a Subtract node to allow you to separate the glow further from the glass. $\endgroup$ – Rich Sedman Sep 22 '17 at 20:23
  • $\begingroup$ The OSL node projects out multiple rays from within the volume to 'probe out' the surrounding mesh. The more rays it sends out, the more accurate the result will be, but the longer it will take to render. The Iterations controls how many of these 'probe rays' it sends out from each point in the volume. $\endgroup$ – Rich Sedman Sep 22 '17 at 20:25
  • $\begingroup$ @Rich Sedman, do you have channel in Youtube? $\endgroup$ – Rita Geraghty stands by Monica Mar 1 '19 at 17:39

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.