Full notes
Full Aiyana update
Read the full published notes in a cleaner layout. The original post stays linked below.
What changed
- Performance
- Maps
Aiyana changes
To start on a positive note I've got fish back in and rendering in a much nicer time using my new systems, so its one step closer to getting all this work onto the main branch. The next and hopefully final things I will be looking into is post processing effects such as Ambient Occlusion and Volumetric Lighting.
So... I knew cloud shadows would be complicated which is why I didn't try to include them in the previous update but it looks like, for now, I'm dropping them entirely.
The first technique I tried with them was to scale up the instancing mesh, which is what I had already implemented for the old clouds so it made sense to try them first.
However once they scale up to match the full cloud cover it got expensive to render since lots of the meshes overlapped and since it didn't match the new style very well I set out to make more accurate shapes.
At first, I tried to replace the meshes with different shapes but it still didn't feel great so I then tried making a custom mesh of cubes that looked something like this.
Steam post imageAt first this looked promising since it was < 0.2ms to render but again as the clouds scaled up this got expensive and again it didn't look that natural anyway. I tried more natural mesh shapes, such as spheres, as a test but the mesh complexity started adding up to costs in other places, it still didn't look great and rendering time was creeping up.
To get around this, I opted for a noise based approach where I would generate a texture to express the cloud shadows and then whilst calculating shadows it would read from this texture. The important step here is that by reading from the texture the GPU would interpolate the results, so when the texture was a tiny resolution like this, it would still render nice round shapes.
With this nice natural shape and something looking good it was starting to feel promising, until I started looking at rendering times whilst raining and it would take more than 1.2ms on my GPU, or 7.5% of the entire rendering time just for cloud shadows.
To put this into more context, rendering the entire terrain, without shadows, takes 1.1ms and even the detailed grass, the most polygons in the scene, takes 1.6ms.
This is a really high cost and it ultimately doesn't feel worth it. I tried various techniques to get this cost down whilst keeping the visual fidelity but with no luck so I decided in the end what I would do is just render a simple quad with a standard shader instead, nothing fancy at all.
This alone, since it is high in the sky and covers the entire scene thus filling the entire shadows texture, takes 0.2ms. A fairly expensive but bearable cost. However... in order to even render this single quad I would need to ramp up/fade in the effect in some way. Without this, the world would appear bright and then instantly it would be darker as its raining, which wont feel geat. For shadows the only real way to do this is something called dithering.
Dithering is were instead of rendering each pixel for shadows, you render say every 2nd or every 3rd pixel (in various patterns like the image above) to give the appearance of a semi transparent shadow, since a true semi transparent shadow isn't really possible in realtime (unless I'm missing something!). This works nicely but as the final nail in the coffin, applying dithering to that simple quad turns the rendering time back to 0.8ms or 5% of my entire rendering budget.
Its a real shame none of these techniques worked out but it just feels really wrong to be spending all this time trying to bring down rendering time to then add on a bunch of time for something that wont look great anyway. I suspect what I will need to do is a full screen effect instead which is something I was trying to avoid because it will always have to fade in/out as you walk into caves or houses. Meaning as you are sitting in a house and looking out the window, things would look bright then as you step out the door things get darker.
Source
Changelog.gg summarizes and formats this update. How we read updates.
