Search code examples
graphicsraytracing

Glowing objects in a raytracer? How it works?


My raytracer has a point light source, it works as it should, illuminates the scene, but there is a problem, it is not visible, I would like to add glowing objects to the raytracer, for example a sphere that would look like the sun

Sun

I need any object to be able to glow whether it's a triangle (or a line?).

Which algorithm should I use?

Sorry for my poor English)


Solution

  • you add sphere which emits light so once your ray hits it the light will be added/multiplied to the ray color ... the glow is done either by atmospheric scattering or just by some semi transparent corona texture rendeed in another pass ... games usually use also bloom filtering which I hate as its too slow and often ugly if overused