teschnei / lotus-engine

11 stars 4 forks source link

Extend lighting system to a more physically accurate one #4

Open teschnei opened 4 years ago

teschnei commented 4 years ago

Current lighting is just a made-up system that looks kind of right. Lights should be improved to have intensities, point lights should be added, multiple lights should be supported. At the same time, think about adding an entity component that holds a light (so that a light can be attached to a model, for example).

teschnei commented 4 years ago

With ray tracing, soft shadows are much easier to do, so maybe transitioning instead to materials emitting light is a better option. Instead of a light being a single point (or single direction), an entity can be used instead, then the ray tracer can shoot x sample rays towards the entity (towards the center, probably, and modified in a Monte Carlo sampling method). If the ray hits the entity with emittance, the origin has the distance modified emittance added as its diffuse. Then denoising should take care of the final image. Note that does still need emitting objects to be contained somewhere so rays can be traced towards emitters. In a full path tracing setup that wouldn't be needed, but is much more computationally heavy.