Rain on windscreen (Patreon)
Content
There is still some work to be done here, but it seems that proof-of-concept works!
The way this effect is working, it uses texture for keeping water so actual final windscreen render pass can be done effectively. However, my initial attempt to store and move rain drops within that texture failed, couldn’t get them to make them stable and not fade out or stretch and cover everything. So here I use particles moving within UV space of that water texture. And the fact that it uses UV space means all windows have to be arranged on a single texture. The way they made in AC, their UV often overlaps, so that’s not good. However, thanks to UVAtlas by Microsoft (https://github.com/microsoft/UVAtlas), now CSP can generate that alternative UV mapping during loading, where all windows are arranged on a same texture. It doesn’t work with all cars, but so far it seems to only have an issue with cars like Alfa Romeo 33 Stradale or other similar cars with windows in their windows.
Here is how generated UV mapping looks like: