691
Anon turns on raytracing (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] AdrianTheFrog@lemmy.world 5 points 6 hours ago* (last edited 3 hours ago)

Yeah, that's just rasterized shadow mapping. It's very common and a lot of old games use it, as well as any modern game. Basically used in any non-raytraced game with dynamic shadows (I think there's only one other way to do it, just directly projecting the geometry, only done by a few very old games that can only cast shadows onto singular flat surfaces).

The idea is that you render the depth of the scene from the perspective of the light source. Then, for each pixel on the screen, to check if it's in shadow, you find it's position on the depth texture. If it's further away than something else from the perspective of the light, it's in shadow, else it isn't. This is filtered to make it smoother. The downside is that it can't support shadows of variable width without some extra hacks that don't work in all cases (aka literally every shadow), to get sharp shadows you need to render that depth map at a very high resolution, rendering a whole depth map is expensive, it renders unseen pixels, doesn't scale that well to low resolutions (like if you wanted 100 very distant shadow catching lights) etc.

Raytraced shadows are actually very elegant since they operate on every screen pixel (allowing quality to naturally increase as you get closer to any area of interest in the shadow) and naturally support varying shadow widths at the cost of noise and maybe some more rays. Although they still scale expensively with many light sources, some modified stochastic methods still look very good and allow far more shadow casting lights than would ever have been possible with pure raster.

You don't notice the lack of shadow casting lights much in games because the artists had to put in a lot of effort and modifications to make sure you wouldn't.

this post was submitted on 23 Jun 2025
691 points (97.9% liked)

Greentext

6554 readers
957 users here now

This is a place to share greentexts and witness the confounding life of Anon. If you're new to the Greentext community, think of it as a sort of zoo with Anon as the main attraction.

Be warned:

If you find yourself getting angry (or god forbid, agreeing) with something Anon has said, you might be doing it wrong.

founded 2 years ago
MODERATORS