EmiOnGit / warbler_grass

A bevy plugin for creating 3d grass in your game
Apache License 2.0
120 stars 11 forks source link

Light affects grass #10

Open EmiOnGit opened 1 year ago

EmiOnGit commented 1 year ago

What problem does this solve or what need does it fill?

Currently grass is not affected by light in the slightest. This means that shadows of objects are not influencing the grass (which looks weird in most games) and in a dark area the grass might look like it's glowing!

However since I do have performance concerns, it should be possible for the user to decide if he wants lighting to affect grass.

NOTE This issue is not about the grass throwing shadows but the grass being influenced by shadows!

Describe the solution you'd like

There shouldn't be a need for realistic lighting. I don't have enough expertise in this topic to provide a good solution currently and would welcome some feedback. My naive approach would be to use shadow mapping on the ground object and simplify the shadow on a blade as the shadow on the point it's standing on. This might look weird on tall grass however.

Describe what is for debate

Well, everything! I also want to point out the possibility to enable shadow mapping on a "grass chunk entity" basis instead of globally. The user could then only activate this option for grass that needs this shadows.

janhohenheim commented 1 year ago

Relevant GDC: Procedural Grass in 'Ghost of Tsushima' I remember they talk about how they implemented shadows, but I don't remember the details.

EmiOnGit commented 1 year ago

I'll check it out! :)