The meshPhong material has “emissive” and “shininess” parameters that affect the calculations in the material shader, but this will not give you the effect you want, they are just used to calculate the final color.
You can place the spotlight, for example, in the exact position as a sphere so that it illuminates the object around it. However, if you want to achieve the effect of a luminous sphere, you will need to write a post-processing shader:
- Change sphere to framebuffer 1.
- Mark the same sphere as the colored yellow (or some other bright color) for framebuffer 2.
- Blurring content in framebuffer 2 as a post-processing effect.
- Mix the original image (framebuffer 1) and the blurry framebuffer 2 to get the final image.
In addition, some examples do not use actual post-processing to achieve the glow, but they use a trick.
You render the sphere, and then render the square with the aura glow texture in the back. Visit: http://threegraphs.com/charts/sample/world/ to see how you can simulate a glow and create a circle around an eclipse around a sphere.
Abstract algorithm
source share