As the weekend approaches, I wanted to end early (midnight) today but it's now gone 4AM. Apart from making the vegetation and entity shader follow in the footsteps of the new shadow system, I've spent probably far too much time tweaking the lighting and pixel effects of the LOWEST shaders to get as close to the HIGHEST ones without adding to the performance hit. It's educational, but it's slow work.
Here is the before shot with everything set to HIGHEST and using the expensive fragment shaders:
Here is the same shot but using my new LOWEST shaders:
The terrain and grass are rendering shadows, and the entity approximates a shadow effect (but I want to do more here somehow/somewhere). Both are rendering all four cascades and the fifth dynamic terrain shadow texture but the LOWEST has a few more tricks in that I can completely switch off the cascades and only draw to the fifth texture when something moves. I did some tests prior to these shows, and I could get another 40 fps by switching them off without loosing my shadows.
The clock has beaten me (once again), but I have had lots of extra ideas on top of what I have now including the addition of meta data into the dynamic terrain shadow texture (DTST) to store information about the shadow being cast (very similar to deferred rendering but with local render targets). This extra info would allow me to shade entities 'above' the floor surface such as tables and things under canopy. I had it 'mostly' working without this, but the tops of entity roofing got shaded too which was a bit displeasing.
I also thought of reading the maximum texture size allowed on the card and then create the DTST to that size, giving my shadows greater resolution. My GeForce 9600 GT can create textures 8192x8192 large, which will increase my shadow resolution by a factor of four. For terrain and grass it is not too noticeable (but enough), but I really need a higher resolution for the entities! It may be straying into visuals vs performance though, and there is much to do yet on the performance side (despite the early good results).
I have still to research the static vs dynamic DTST idea to avoid rendering ANY static entities after the initial blast, and using a different texture format for the DTST to reduce the memory it takes (16MB right now, 262MB if I use a 8192x8192 texture). Ouch. With an 8-bit format, this would drop to a more friendly 65MB. AND I want to see how much I can move some of the pixel shader work into the vertex shader to increase calculation efficiency. So many ideas, too little time!
Before I turn-in, I will leave you with a video monologue I made this afternoon as I was attempting to explain the new shadow system. I think it merely serves to confuse everyone, but it's material you might like:
Have a good weekend, and if I get up in time, I might have one too. I just realized "Thief" (reboot) has been released on Steam and I had it pre-ordered, so I think I will play a few hours of my all time favorite franchise as a little treat for getting some serious performance work done this week.
Well done Lee! This truly looks like a real performance boost! That's why it's called Research & Development.
ReplyDeleteFantastic news
ReplyDeleteGood work old bean. Did you check out grimrock for other ideas on latest blog for optimisation.
Well done though fantastic to know we're going to get a fantastic beta soon
"and I could get another 40 fps by switching them off without loosing my shadows." Switch what off?
ReplyDeleteThere are four cascade shadow render targets that are updated each cycle. With the new long-term shadow storage texture, these cycle refreshes are redundant unless something moves. For static shadows, nothing moves, allowing some further optimization here.
ReplyDeleteNow THIS is what a low-high setting should look like! Minimal difference in visual quality but big difference in framerate! Much more pleased with this than with previous versions xD :D And by the sounds of it, you've made even the high settings run well :)
ReplyDeleteSounds encouraging news. Let's hope next week heralds more of it!
ReplyDeleteGreat work again lee.
ReplyDeleteoh man I remember the game Thief that was so much fun. It was also the first "RPG" FPS game I ever played. I always found it kind of scary though when I was younger though lol
ReplyDeleteUnfortunately, according to Good Game (one of my favourite TV shows) on the ABC (Australian Broadcasting Corporation, not American Broadcasting Company), the game just doesn't have the same feel or even gameplay as the original Thief game. Still probably a fun game, just don't expect to be playing the same way as in the original.
ReplyDeleteIt's big publisher thinking. Make the game idiot proof so we can sell more of them. I've only played two hours of it, and it's very good, but I agree it's not the original and also feels like I am on rails. At the very start, there was a nice street scene below but I could not leap off the plank I was walking along to investigate. The invisible collision boxes kept me on the straight and narrow :(
ReplyDeleteIt's sad but that's the way every big game goes...
DeleteHopefully we can make good use of Reloaded to further the indie revolution against big publishers! ;)