[15.21] Shadow not cast on trains correctly

Bugs that are actually features.
Post Reply
mrgnl
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Nov 29, 2016 4:47 pm
Contact:

[15.21] Shadow not cast on trains correctly

Post by mrgnl »

Description: Shadows from trees (and possibly other entities) are not case on trains correctly.

Steps to reproduce:
  • Lay a north-south railway east of a tree.
  • Place a train on the rail.
  • Drive train past tree.
Result: Tree shadow only cast on lower part of train.

Expected result: Tree shadow cast on entire train.

Video of problem (YouTube): here
Log (Pastebin): here
Savegame (Google Drive): here

Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13236
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [15.21] Shadow not cast on trains correctly

Post by Rseding91 »

That's because trains use special rendering to stay above most entities and the shadows on the trees are baked into the tree sprite.
If you want to get ahold of me I'm almost always on Discord.

mrgnl
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Nov 29, 2016 4:47 pm
Contact:

Re: [15.21] Shadow not cast on trains correctly

Post by mrgnl »

Rseding91 wrote:That's because trains use special rendering to stay above most entities and the shadows on the trees are baked into the tree sprite.
True as that might be, as a player :roll: I expect the shadow to be cast correctly on a train. All players will experience this issue/feature.

I noticed the topic was moved to 'not a bug'. It would be great if you could mention that in your response. And, now that I've discovered this 'verdict': since we're seeing a graphical glitch I think that, even though technically it's intended to be rendered this way, it's an issue as it doesn't look&feel right. Please consider moving this to "Minor issues" instead.

Technical:
Simply rendering entities from top to bottom doesn't work with items (like trains, trees, etc) that span a larger area. Therefore it might be worth considering rendering entities' shadows separately. Or to do so on at least the 'HIGH' graphics setting (which I'm running on in this example). Personally I'd put correctly rendering shadows very close to high-res graphics (especially since this is disabled by default and shadows are enabled by default).

Rseding91
Factorio Staff
Factorio Staff
Posts: 13236
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [15.21] Shadow not cast on trains correctly

Post by Rseding91 »

In order to render shadows independent of the entities we would need to go over every entity in the game and separate the shadow from the entity. That has several downsides to fix what is an extremely minor thing you almost never notice while playing:
  • It will take hundreds of man hours
  • It will increase the VRAM usage because now what was 1 combined sprite is now 2
  • It will reduce render performance because what was 1 combined sprite is now 2
  • It increases the render code for each entity because now each has to render a normal sprite and a shadow
  • It increases the entity prototype definition complexity because the shadow sprite and the normal sprite both have to be defined with perfect scaling/shifting
All of that to fix some minor graphics quirks for shadows. It still won't fix things like the train renders on top of some entities when in vertical/angled orientations and probably wouldn't fix the shadows thing completely either.

So, that's why we decided that this isn't a bug.
If you want to get ahold of me I'm almost always on Discord.

mrgnl
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Nov 29, 2016 4:47 pm
Contact:

Re: [15.21] Shadow not cast on trains correctly

Post by mrgnl »

Since there's no 'like' feature on this forum, one more post from my end: Thanks Rseding91, love the detail! I understand the impact of such a change and the classification. Good luck with getting .15 out there and thanks for all the hard work.

Post Reply

Return to “Not a bug”