2
$\begingroup$

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

enter image description here

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

How to implement it?

Sorry for my poor English)

$\endgroup$
2
  • $\begingroup$ Your question asks about glowing objects, but the posted image shows atmospherics. Do you want glowing or atmospherics? $\endgroup$
    – pmw1234
    Commented Jan 9, 2023 at 14:17
  • $\begingroup$ glowing objects $\endgroup$ Commented Jan 10, 2023 at 18:22

2 Answers 2

2
$\begingroup$

I assume you mean glowing geometry (not sky functions). There are several ways to do this, but as a simple example (not optimized ofc): since you have a pointlight you could ray trace a sphere or project a 3D disk with analytic AA (would remove jaggies/flicker at great distance) into a separate texture (with visibility occlusion!) and apply a bloom filter on top of the sphere (maybe separated Gaussian filter or according to: Physically Based Bloom).

Hope this was helpful!

$\endgroup$
1
$\begingroup$

Another option to make objects glow for Ray tracers in particular is to add an emissive material to objects that need to glow.

Essentially make the objects generate light. The color of the light is the color you want the object to glow. Radius, strength and density are also options. Implementation generally can play off existing code when rays are being traced. Also the implementation can start off fairly simple as an integration of a constant density over the distance a ray travels through the glowing region. Which can be solved analytically. It can also be extended without major changes to handle reflections, scattering, the list goes on and on. Essentially when a physically based effect is added to the system in general, it can be added to objects that glow, even made an option.

It is a larger effort to get it up and running, but makes for a nice physically based implementation for ray tracers that are going that direction.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.