I made a game! Buy on Steam

This article was updated. Jump to Update 1. Update 2.

I just noticed, that this window can not be seen through another window on the other side of the building:

Source: Infinity Nikki

My guess: It’s an optimization to save some polygons.

The back of the wall is most likely one huge quad (instead of at least four), but thanks to back-face culling, this quad does not block the view when we look inside the room.

Source: Infinity Nikki

But why can we still see the sun shining into the room? I assume they use only the front-faces for the shadow map calculation and with that, the sun ignores the big back-face quad.

๐ŸŒž

By the way, a little info-nugget about a game I worked on (Sacred 2):

For this game, back-faces were used for the shadow map calculation (also called “front-face culling“). One artifact of this is, that it’s possible to see small light leaks like this:

Source: Sacred 2

A reason for using back-faces for the shadow map: it fixes the so-called “peter panning” (read more about it here).

But a new problem arises by using this technique: a common optimization (for top-down games like Sacred 2) of removing the polygons on the underside (aka back-faces) of objects doesn’t work anymore since, for example, a tabletop would not cast any shadow.

So we had to make sure that all our tables, bridges, etc. had nice polygons on the underside, even if the player will never see them:

Source: Sacred 2

Have a nice day! ๐ŸŒž
Simon

Update 1

Just noticed another small optimization in the game. Objects, which are out of view, stop being animated. Wouldn’t be noticeable, except if the shadow (or the sun! Again!) wouldn’t reveal the secret:

Source: Infinity Nikki

Another tidbit: Some NPCs, which are too far off the screen, get their animations disabled as well. But this doesn’t seem to be related to the camera frustum, but probably a simple dot product between the camera view vector and the NPC position relative to the camera. I assume that, because when you play in 32:9 you can see some NPCs stop their animation while they are still on-screen.

Source: Infinity Nikki

I guess the developer didn’t test this optimization in super wide screen.

Update 2

Harlist shared this video on my discord, where we can see how the enemy animation in Elden Ring has a lower FPS when being offscreen:

Source: Elden Ring