5
$\begingroup$

As I had much fun with this (thx Chebhou) but gaussian functions are a bit too complex for me, i want my volume scatter cylinder to have simply a smaller cylinder emitting light inside it, from the same object/material. The same size all along, or why not being able to control the fading at one or both sides (why not asking :) )

It has to be done with math nodes, vectors and things like that (what I want to learn)

Something like this but in a single object enter image description here

looks like a light saber :)

$\endgroup$
  • $\begingroup$ related: blender.stackexchange.com/a/15711/1853 and blender.stackexchange.com/a/3640/1853 $\endgroup$ – cegaton Feb 13 '15 at 17:11
  • $\begingroup$ @cegaton nope, i don't want a compositing or modeling answer, it has to be shader maths. I already did (long ago) a light saber but i want to learn more about math nodes and vectors in materials. I hope this is simple enough for me to understand the why and how. $\endgroup$ – Bithur Feb 13 '15 at 17:16
2
$\begingroup$

use this circle equation and chose a radius "max R = 0.5" :

enter image description here

Coordinates node group : enter image description here

and for fading on the sides i used a sin function :

enter image description here

render : enter image description here

$\endgroup$
  • 1
    $\begingroup$ seems like what i wanted, checking details :) $\endgroup$ – Bithur Feb 13 '15 at 17:28
  • $\begingroup$ the sin doesn't seem to fade the light, it just stops at both ends. $\endgroup$ – Bithur Feb 13 '15 at 18:19
  • $\begingroup$ it fades but in short range that it's not clearly visible because that's how a sin wave is, you can replace with other functions $\endgroup$ – Chebhou Feb 13 '15 at 18:26
  • 1
    $\begingroup$ Max R=0.5 :) A max value of 1 would be for diameter. $\endgroup$ – Bithur Feb 15 '15 at 12:54
  • $\begingroup$ yeah, you are right $\endgroup$ – Chebhou Feb 15 '15 at 13:23
2
$\begingroup$

Variation on Chebhou's answer : Origin and dimension independant :
enter image description here

Not sure the sine works exactly the same.

$\endgroup$
  • $\begingroup$ that's brilliant ! it is dimension ,and origin dependent $\endgroup$ – Chebhou Feb 15 '15 at 16:26

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.