Wednesday, 25 September 2013

Wednesday Woes

It's Not All Cherries and Cream

A pretty 'orrid day really. Started good with some clean-up of the shadows and optimizations  and then came the re-integration of the color maps. This was when the dreaded performance monster caught up with me. I have escaped the beast for many a moon, but today it found me.

Turns out rendering the whole terrain in full polygon glory twice is a little too much for my graphics card and my FPS dropped to 43 fps. Completely unacceptable considering other parts of the engine where not engaged. Not sure the cause, but my first guess is that rendering that many polygons twice was too much, and that subtle use of a pixel shader is the solution out of this.  It could also be something silly, and not the first time, but for tonight and my frazzled brain, I do not know which.

Solutions Pending

I have a few ideas how to get around this one, but really the main idea was to double up on my texture slots and get the job done. Turns out I cannot do that without a 'significant' performance thump. One idea is to use more than eight texture slots, limiting the cards Reloaded could run on. Another is to create texture plates with four texture patterns and normals on them, therefore staying within the eight texture slots limit, but requiring some fiendish texture wrapping math in the pixel shader. A third option is to drop normal maps and shadows altogether and move on. A forth is to somehow have a 'shadow shader' which can overlay the established terrain surface. In fact there are as many solution as I could dream up, but I need one that I can code within the day, will perform at top speed and fit nicely with that I have already coded.  The life of a coder is never dull!

Pre-beta 'don't look if your name is Rick' Screenshot

So you don't feel too dejected, and not wishing to share my pain, here is a nice screenshot from my horrid proto with the color stripped out. As you can see, nice shadows and normals under the colored vegetation, and the vegetation being shadowed too which was no small feat! Also shadows spanning off into the distance, you can't see this, also no small feat!

I had hoped to show you a full color screenshot or even video of the shadows in all their glory, but not at 43 fps!!  No Sir!

Signing Off

I either need to find the route cause of this performance hog when rendering the full screen terrain twice, or find a new way to have colored textures, normals, veg map and cascade shadow maps all in the same shader pass.  No one will thank me for pretty visuals and horrid performance, so this needs solving right now or we have to back track on our visual ambitions!  Fear not, it's me we're worrying over, and I usually find a solution, eventually ;)


  1. "A third option is to drop normal maps and shadows altogether and move on."

    That's not an option! No way! That shouldn't even be on the cards.

    As far as I am concerned this is basic, visual functionality. Both of those. Is this quite possibly the situation where improving an old engine as opposed to creating another from the ground up is coming back to bite us in the backside. :(

  2. This comment has been removed by the author.

  3. I agree with the fellow above.

    Take a day longer and work it out, I think you might regret it if you leave something which is as fundamental as that out.

  4. Hi Lee,

    Its not Rick so you are OK. Thanks for the screen shot. They are all very interesting when following your Blog content describing your days work.

    I have no idea of course what you are going through but seems to me there are too many options and not an obvious one for you. I am sure a process of elimination will provide an answer when any will narrow itself down to a best option and users will have to live with it. Not much option if there are few or none :-)

    I can understand how you must be feeling - bad days are not good I know - keep your chin up. Tomorrow is another day.

    Thanks again for the hard work being put into Reloaded.

  5. "A third option is to drop normal maps and shadows altogether and move on"

    This is not an option. We must have terrain normal maps and dynamic shadows in Reloaded. If it comes to it you must increase the texture slots beyond 8 and increase the minimum specification for Reloaded to current generation graphics cards.

    Another option is to not have dynamic shadows visible all the way off in the distance but only have them visible to a specified draw distance and culled beyond that to help improve the performance.

    At the end of the day FPSC Reloaded is shaping up to be a top quality FPS engine and dropping essential features like bump mapping and dynamic shadows would be devastating to the project.

    I will put that option down to the JD and coke you had and that everything will become clear when you look at this again in the morning !!

  6. I feel like maybe you need to increase the texture slots. While supporting many graphics cards out of the box is great, technology will be moving along!

    Looking forward to the beta!

  7. Let me suggest that if you show your shader to the community they (we) may be able to help you.

    I have a semi-decent graphics now (GTS250) so I'm not completely averse to the idea of >8 texture slots, but I still have nightmares about being the minority group with older hardware and bad internet and getting no support from the big companies (which is why ALL my games will always support old hardware and old techniques).

  8. Hi Lee, sorry to hear your day was a troubled one. It's not supposed to be easy! I will do some research while you sleep and see if I can find some help. Maybe our friends at nVidia can advise?


  9. I say take nvidia advice what rick finds out. Chin up old bean. I had a bad day at work yesterday but tomorrow is a new day. And new gusto and determination comes from a good kip. I think you're doing good. Also l am happy with more than 8 slots too. As most will be about there. Old cards will burn out so I think people will be happy with the choice of more than 8

  10. Hello Lee, i would give you an extra option: Feature available based on texture units, when i launch the software IT show to me how many texture units my vidoecard have and i will be able to select/deselect some "core" options. the fact i have for example a 8 texture units card does not mean that a final user that play my game have it.. actually i have an ATI HD 5770 buyed almost two years ago, and it was at that time a "mid range card" it have 40 texture units, i think 8 texture units card are really older cards or maybe some mounted on netbook (not really game machines) I remember when i had older video cards (non HD) i've do disable some options to let games run smoothly.. so mayble i'm blind, but i do not really see the problem, an old video card will not support some functions. i would very happy to play a final game made with FPSC:R on commodore 64 but, hey!!! ;)

  11. FPSC Reloaded must aim for the highest quality possible and the features should scale down for older cards but we must have the full features available for people that either already have a current generation video card or prepared to upgrade.

    One thing we can't afford to do is baseline Reloaded on an integrated laptop video card. That would not be a good direction and its not unreasonable to expect people to have a dedicated graphics card for a top FPS game engine.

    Most people commenting are in agreement that going above the 8 texture slots is acceptable and I agree with that. If Lee is unable to come up with a work around to allow terrain bump mapping and dynamic shadows then we should go with this option.

  12. Hello Lee,

    I'm sure you can go ahead and increase the texture slots to 16 or more. This opens up even more possibilities and every of today's potent GPU's can get around with this. My GTX 680 has 128 texture units, the much cheaper GTX 660 still has 96 and even the lower end GTX 650 has 32 of them (GTX 650Ti has 64).

    One doesn't need to spend a lot of money to use new features today. Some would need to upgrade, but you are giving the engine a big upgrade, too, don't you? :)

    Graphics wise a mid-range engine is used here and it should target future mid-range graphics cards. That's the only way it makes sense for me. Normal mapping or dynamic shadows could be options for people with a fitting graphics card. The best compromise would be to have most of the options turned on and off so the engine could scale with the hardware given.


  13. You are looking at gts 8800 320mb card to only hold 8 units. Back in 2008 and earlier. That is over 5 years ago. And x10 worries were that it was on new vista and x10 and they were top dollar plus no one wanted vista. And anyone who has hardware pre dating x10 release need to update I think. Since 2008 I have had 3 since. Suggest aim higher

  14. Even the 8800GTS had 64 texture mapping units. :)


  15. Lee

    Please aim for a higher specification video card. I was thinking we were taking about this years crop of high end cards for a minute, not video cards from 5 years ago LOL.

    Not including normal mapping and dynamic shadows to support people with 5+ year old cards is not a viable option for Reloaded. We are aiming for the stars here folks.

    Now where is that new video with lots of dynamic shadows and cool terrain bump mapping Lee?

  16. The lowest laptop gpu to have more than 8 tmu is the gforce 525m and above
    Apu a6 a8 and above
    radeon 6500m and above so my view is it be ok to do up to 16

  17. I may be well wrong here but it seems to me that Lee and Reloaded face more issues than just the current one being discussed.

    It is likely to be the case and we can see some of this having taken place perhaps that whichever way you look at it Reloaded and the core engine is being expected to be able to handle a lot of data to provide a lot on screen and happening at once.

    Whether thats shaders, shadows or AI and much more and the question is will it be able to do so on any machine. A bottleneck is a bottleneck and has always been an issue in low end indie engines which have a core which is limited in its ability to manage efficiently high levels of data streams at any one time.

    Classic was the same and Reloaded will be no different unless you expect or have effectively an unlimited capacity and can have just whatever you like going on all at once which is unlikely to be the case.

    Unlimited would be good and that has to then be able to be effectively streamed to suit the machines of your average game makers and game players machine.

    Everyone here can ask for what you like but Reloaded has to be able to provide it and more importantly the user/player market whoever they are as envisaged by TGC in great enough numbers to be able to purchase the product and games made with it have to have the hardware to make it viable.

    Those are all realities. Its also by and large a commercial thing and it is bigger than the small number of users and pledgers supporting and following Reloaded at the moment and has to be i hope as there's just a not enough of you or us to make Reloaded viable long term at the moment so you have to tailor Reloaded somewhere sensibly even if you have some choice.

    Likely that as said the basic core and its efficiency will dictate what you can and cant achieve. You cant make it do what you want or it cant do if it grinds to a halt. That will not serve any purpose either other than to give you a worse situation than classic.

    My oipnion and tell me if I am wrong is support for TGC and Relaoded needs to be much greater and I can see this as I follow it and the numbers of users here and at the TGC site, forums and so on and there needs to be more. Many more.

    I agree with all sentiments here but everyone including TGC have to be realistic. Reloaded is and wont be at the same level of engine status as a lot may want it to be approaching the level of quality for features you can see in top AAA titles or some other game engines out there so no point in expecting it to be so. Its not built from the ground up in the same way is it and it does not have the support of resources that others do that you aspire too.

    Personally I am and have never been too carried away with it and if you can cram Top Tile features into it and get it to work then I am all for it but try and keep an open mind so I wont be disappointed.

    Lee I am sure will crack something here however you cant have one thing at the expense of another. As always saying a balance is required and some compromises may have to be accepted or it may fall over altogether..


  18. When I was pointing out the texture map units it I believe is more like a layer upon layer to achieve efx and the more texture maps the more layers to add. He has seemingly ran out of layers and so having to draw things twice to get the effect. So and after I looked I saw only integrated cpu i3.5.7 and none fusion chips and very low end laptops are 8 or less. Now integrated I series have 1tmu till Ivybridge which has 2 tmu. So integrated on own can't cut it so really the only machines he would lose market target is the very low gpu laptops. even though now most fusions have 16 + tmu so it is only a few low ends that cannot handle it. But saying that why should they lose out which is fair point too. I think though lee did say he wanted tpp quality and is aiming high. Otherwise why bother in first place. So he will either find a solution or choose to do a budget engine for notebook's or go for a mid to high end product. But my research shows about 60+ of gpu out there is more than capable of over 8 tmu. But we can wait and see. I was merely showing some stats and viewpoint. And maybe he could do the switch on off system. :)

  19. It seems pretty clear at this point that we can accomodate more than 8 texture slots on the average users system. People that buy laptops for gaming understand you need to go with something fairly high spec to stand a chance of running anything modern with a playable framerate.

    Holding Relaoded back to support older cards is not something we want to see happening. If its possible to support older cards then great but that cannot be the driving force for the features being added to the engine. Its exactly things like dynamic shadows that will set Reloaded apart from FPSC classic and must be accomodated.

  20. We could also take into account that there is no other product like FPSC/R on the market and probably won't be for a lot of years to come. If after 5 years it will still be the only product of its kind but it would be optimized for 10 year old low-end graphic cards, it would just be what the original FPSC is to todays' standards.

  21. I agree with Nomad Soul, Reloaded should continue to aim high.