I didn't really liked the approach of using a large flipbook or a realtime rendered texture for rain. Kinda seems overkill for such a small effect. Also the flipbook approach has a limited framerate on top.
But then it hit me, that a single ripple could easily be recreated with good old polar coordinates! But that's just for one ripple only, right? Well then take a look at this little texture here to the left:'D
Instead of using one polar coordinate system, why not put several on one texture, thats than used to sample a rain normal map (to the right). Of course there will be problems, when the wrapped rain texture reaches the edges, but that can be solved with a mask.
Also cool thing about this, for each polar coordinate tile, i can use an offset to sample the rain texture at a different point in time. Which basically results in completly unique "spawntimes" of the ripples.
To create overlapping ripples and more complexity, you'd just sample the base uv texture a second time, with a different offset and combine them.
Also i calculate the correct normal rotation with the help of this weird gradient, that defines the angle of the uvs in combination with a simple 2d matrix. Which then can be fed into the normal buffer to get the correct reflections etc.
The textures can also still be "optimized" (spacewise) if thats even necessary, as in the example above, they both are only 64x64 pixel big. So yeah. 5kb seems nicer than a 5mb 2k flipbookxD
• • •
Missing some Tweet in this thread? You can try to
force a refresh