Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

FPS Graph - Performance Analyzer Tool

Discussion in 'Assets and Asset Store' started by dentedpixel, Jan 18, 2013.

  1. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    FPS Graph is a tool for tracking the frame rate of your scene over a period of time. This can help you distinguish spikes in the framerate and figure out how they can be eliminated.

    Available Now in the Asset Store

    Features
    - COLOR coding of different tasks: CPU, rendering and other are broken up into three different colors.
    - Lightweight: Does not weigh down your project
    - Simple Setup: Just add the script to your camera
    - Audio Feedback: You have the option to audibly hear the framerate. When your game is running along quickly it is a low rumble, but if it is struggling it will be high pitched.
    - Works with both C# and Javascript







    Note: Unity’s built-in Stats menu is actually the estimated FPS (estimating what the fps would be if the game where not running in the editor), if you want them to be more in-sync I would suggest closing your scene view. More information here
     
    Last edited: Feb 5, 2013
  2. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Looks truly awesome, even for Unity Pro users (since I suppose you can implement it in a project's debug setup and activate it outside the Editor for additional testing purposes - which is very useful). Superbly nice, eager to grab it from the Asset Store :)
     
  3. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    FPS Graph is out now for the low-low price of $5. Act now supplies are limited! (ok they aren't limited, that was my inner salesman coming out).
     
  4. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Awesome! Now it's superlate, but I can't wait to get my hands on it tomorrow afternoon and implement it in all my projects! And with that price, it's a must-buy! :)
     
  5. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Looks AWESOME !

    I got couple of suggestions though -

    1. About the font - while it looks cool to use pixel font, it can be hard to read sometimes. Perhaps a function for user to change font style and font size? Its not a deal breaker for me, but I think I would like to have the option.

    2. Another suggestion would be to allow user to change color code - again, not a deal breaker, but would be nice to have....
     
  6. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    As someone who purchased 5 stared your tool, upvote #1 big time!
     
  7. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    A font option is definitely something I can add. I just wanted to keep the draw calls down, that's why I went with the pixel font (plus I also like the old-school style of it).

    The color coding is something I can easily add as well. Were you thinking of something more along the line of different color themes, or just a color chooser?

    Thanks for the suggestions!
     
  8. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Personally i don't care for choice (neither for font nor color), i'd just like something readable and professional, like the fons used in the unity stat window, actually i'd explicitely like something that does "not" try to be "old school" or "cool" or anything really beside readable and professional.
     
  9. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    I am just wondering would it even change draw call count if you use another style of font?
    As for color coding, I was thinking just a color chooser. Just something simple.
     
  10. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    It probably would, because I am actually drawing all of the text manually using GL.Quads. I know it's a bit of overkill but helps a bit on performance :D (really only important on mobile testing)
     
  11. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    I just got it and love it!

    About the font option, I would downvote that, since performance is the most important thing in a tool like this :)
     
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,163
    I love the sounds it creates, very clear feedback to whats going on , must buy!
     
  13. mrKaizen

    mrKaizen

    Joined:
    Feb 14, 2011
    Posts:
    139
    This is cool. Bought -_^
     
  14. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    A new version of FPS Graph is out, now you have the option to change the colors used.

    There is also a C# and Javascript included. Thanks LZitmee for helping me port it over!

    Thanks everyone for their feedback!
     
  15. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Ahaha now I fear most people do that same error: my nick's first letter is not a lowercase "L", but an uppercase "I", so that the nick is pronounced like "is it me" - sorry for the off-topic comment ;)
     
  16. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh haha, my bad! I'll get it right next time, that capital "I" can be tricky. Now your nickname makes much more sense. I was reading it L-Zit-Mee ;)
     
  17. freakdave

    freakdave

    Joined:
    Nov 18, 2012
    Posts:
    78
    I purchased it. It rocks!
     
  18. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Got it. ;)
    But, not running on a compiled project. Editor only?
     
  19. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Hey ZJP :) Just for feedback: works perfectly for me on a compiled project. I added a key that when pressed attaches FPS Graph and shows it, and viceversa.
     
  20. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey ZJP it should work fine on compiled projects, at least I haven't run into any issues. Can I ask what type of compiled project this is? iOS? PC/Mac Standalone?
     
  21. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    PC Standalone. I've found the pb : Doesn't works with any Post-Process Shader i've tried.
    Maybe a sort of "Drawing/Render/Buffer priority" issue. ;)

    JP

    Edit :

    Win 7/32, Radeon HD 7850.
     
    Last edited: Feb 5, 2013
  22. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    I can move the main drawing operations to the PostRender process. Hopefully this will resolve your issue, and if it does I will update the product in the Asset Store. I will send you a private message with a link to the updated code if you don't mind testing (I do not have Unity Pro unfortunately so I can't test Post Processing effects).
     
  23. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    DentedPixel sent me a version that solves the pb.. Very fast support. Thanks. ;)
    Waiting for a Csharp version. Nice job.
     
  24. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    A new version of FPS Graph is up on the Asset Store. This update addresses some of ZJP concerns about it not working correctly with post-processing shaders (it now works with those).

    Thanks for letting me know ZJP!

    I also removed some unused code which should speed up things a little...
     
  25. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    You're welcome ;)
     
  26. Acelondoner

    Acelondoner

    Joined:
    Jul 27, 2012
    Posts:
    101
    Good to see this finally released. Cheap price also. It's a buy from me.
     
  27. m4rc0mw4r

    m4rc0mw4r

    Joined:
    Oct 29, 2012
    Posts:
    50
    If you use it for android or ios, doesn't it take the whole screen, or can you adjust the size?
    Thanks!
     
  28. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    You can adjust the size, position and amount of bars that are shown on the graph. You can also change the zoom level (by default it zooms into the graph by 2x) to make it more readable, but you can set that value to 1x or any value you would like.
     
  29. m4rc0mw4r

    m4rc0mw4r

    Joined:
    Oct 29, 2012
    Posts:
    50
    Ok thank you it's really awesome stuff! I think i'm going to create a benchmark application for android that developers can see if the newest devices can run the amount of polygons which they can also see.
     
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Thought I'd post a link to an FPS Graph enabled game :) I just published Stackout on Kongregate, and if you have keyboard focus on the game and press the backslash key (\), FPS Graph jumps out - while pressing backslash again removes it. I love having the chance to see debug infos like this even on released apps :)
     
  31. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Izitmee I love it! The design style is great! How did you do those shadows? Fun-game, I think I am may need one of those high-dpi gamer mouses to really progress far in the game.

    How has your experience been with Kongregate? I am planning on porting my Unity game: Monkeyshines to that platform soon...
     
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,234
    Thanks :) And I'm implementing keyboard controls right now, so no need for high-dpi mouses anymore :D

    My Kongregate experience is very recent (less than a week), so for now I have not much to say :p My main problems were A) I was quite baffled by the documents they ask to pay you money, some of which I never heard about, B) there is no place where you can find clear explanations of their basic rules (I wrote a blog about it, and how to implement badges with Unity).

    EDIT: oh, and those shadows are the default realtime shadows of Unity Pro :p
     
  33. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Damn, I have to go pro! Those are some nice default shadows.

    It doesn't look like it's been that great of an experience working with Kongregate API. I think I will stay away from that badge system for the time being... And those payment documents. Well as long as you get paid! I guess there aren't that many other options out there, so what are you going to do.

    I can't wait for the keyboard controls, although I was getting better at it with my low-dpi mouse after some practice :-D
     
  34. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
  35. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Sorry to see you are having trouble. The Unity IDE could very well be reporting the FPS incorrectly as it tries to report what the "estimated fps" is while my script gives the actual elapsed milliseconds (than converted to FPS). You can find out more information here: http://forum.unity3d.com/threads/150139-Is-unity-FPS-count-wrong-or-am-i-missing-something/page2#post_message_1074929 .

    That being said, it could be a bug in the script. Did it "feal" like 15 fps (jerky movement)? Also you could run it in XCode and get the FPS in the profiler there to compare it (if you are building for iOS).
     
  36. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
    It seems that your counter doesn't take in account what happens in FixedUpdate.
    I tested in editor and in a build with attached profiler. Same behavior. Unity 4.1.
     
  37. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Okay, thank you for bringing this to my attention. I will take a look to see if anything can be done to fix this...
     
  38. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    Music to our ears, we were noticing that this graph was making us smile with 40fps while xcode is breaking the bad news that we're actually at 20fps :(. Can't wait to get this update so we can use the graph again
     
  39. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    226
    There is one significant flaw, graph doesn't get rendered on Android devices. Still it does its job by providing audio feedback (except I can't tell if it's a graphics lag or cpu lag).
    I can see the graphics background as a black opaque box and "other", "cpu", "render" white text, nothing else.

    Tried to remove creation of temporary material and shader, but it didn't solve the issue.
    Removed "// Shadow for whole graph" lines, now i can see the graph, but it's all completely opaque-black.
    Removing "// Add FPS Shadows" and changing GL.Color of everything to "White" didn't make any changes.

    Samsung Galaxy S3 GT-I9300

    ...

    Edit: Oh hey ! I have fixed it. I just made it use unity's "GUI/Text Shader" and everything works fine now.
     
    Last edited: May 25, 2013
  40. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Awesome! I hadn't tested on Android in awhile I guess I just assumed it worked... Could you share the actual code change you made so I can provide this fix for everyone?

    Thanks!
     
  41. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Good news guys, it should take into account the FixedUpdate now. Thank you for bringing this to my attention.
     
  42. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    226
    nothing special, just a crude fix

    Code (csharp):
    1. public class FPSGraphC : MonoBehaviour
    2. {
    3.     //public static Material mat;
    4.     public Material mat; // drag and drop new material with GUI/Text Shader in the inspector here
    5.  
    6.     static void CreateLineMaterial() {
    7.         /*
    8.         if( !mat ) {
    9.             mat = new Material( "Shader \"Lines/Colored Blended\" {" +
    10.                 "SubShader { Pass { " +
    11.                 "    Blend SrcAlpha OneMinusSrcAlpha " +
    12.                 "    ZWrite Off Cull Off Fog { Mode Off } " +
    13.                 "    BindChannels {" +
    14.                 "      Bind \"vertex\", vertex Bind \"color\", color }" +
    15.                 "} } }" );
    16.             mat.hideFlags = HideFlags.HideAndDontSave;
    17.             mat.shader.hideFlags = HideFlags.HideAndDontSave;
    18.         }
    19.         */
    20.     }
    21.        ...
     
  43. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks Shame. I was hoping I could do something in the code to keep people from having to manually attach a Material, but after a couple of hours of trying to get a material to work, it doesn't seem to be possible (well an Android compatible shader that is). I think I will use your solution after-all because it's certainly better than nothing.

    If anybody knows a GUI Android compatible shader that can be written "inline" (in the code itselft), please let me know!
     
  44. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I tried this on Android device Samsung Note 2, it drops my fps so much that it cannot be used.
     
  45. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Sorry to hear that @imtrobin. I can't guarantee good performance on all devices, but have you tried lowering the frameHistoryLength value to something much smaller? That might allow you to have reasonable performance...
     
  46. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    It drops from 40 fps to 20 fps on mobile device. It takes too much performance, it can't be used to measure. performance
     
  47. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Damn, that is pretty bad. I tried it on my Amazon Fire and it didn't seem to effect performance too much, and it hardly effects performance at all on my iPad. I have a feeling it might the shader material you are using, is it the standard GUI/Text Shader ?

    Anybody out there know of a lighter GUI Shader that works on Android? Maybe I can find one that doesn't support alpha transparency, since I think that might be what is killing it on Android devices specifically...

    Ok, sorry for thinking out loud so much there, just trying to get to the bottom of the situation.
     
  48. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    We've seen the same kind of drops on our devices here as well.
     
  49. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey guys, I have submitted a new version to the Asset Store (it's not up yet), that standardizes using a different material for Android devices (material included). Hopefully this will help out. The material I am using causes negligible performance overhead in my tests on my Android Fire (it's the old fire, so not a very impressive machine). Hopefully you will find the same performance for your own devices!
     
  50. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    I updated our version on the 17th and running it in our build dropped the framerate by over half and that is on a pretty decent Mac Book pro. Problem seems worse now :(
     
unityunity