WebGPU Engine from Scratch Part 12: Ambient Lighting
dev.to·5d·
Discuss: DEV
🏔️Alpine.js
Preview
Report Post

One persistent quality issue with the engine is that the shadows are very hard because things are either lit or not lit. In the real world there’s a lot of ambient light that comes in from all angles because the rays are bouncing off the walls, clouds and other objects. We don’t take this into account. Realistically, this can’t be computed at all because it explodes exponentially tracing the rays as they diffuse into multiple rays. The most sophisticated renderers use things like path-tracing to aggressively estimate light. Our version will do something similar though more suitable for real-time rendering without a ray-tracing support.

The API

There’s a few ways we could tackle this. We could create a new type of light "ambient" that just adds this to the scene. I don’t want…

Similar Posts

Loading similar posts...