Three.js - sphere that glows

karlosss picture karlosss · May 3, 2013 · Viewed 25.4k times · Source

I have a problem. I want to make a sphere which works like a source of light (sun). I found out that meshPhongMaterial has an option like emissive: color and shininess: intensity but I did not manage to code the sun. Does anyone know how to do it? Thank you for answers!

Answer

Lee Stemkoski picture Lee Stemkoski · Jun 11, 2013

If you are looking to create a glow-style effect, I have a written a number of examples at http://stemkoski.github.io/Three.js/ that may be helpful, including:

http://stemkoski.github.io/Three.js/Selective-Glow.html
with accompanying blog post
http://stemkoski.blogspot.com/2013/03/using-shaders-and-selective-glow.html

as well as the more atmospheric-style glow effects

http://stemkoski.github.io/Three.js/Atmosphere.html
and
http://stemkoski.github.io/Three.js/Shader-Halo.html

Hope this helps!