User Tag List

Results 1 to 8 of 8

Thread: Fade Transitions cause a very high GPU Utilization?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Fade Transitions cause a very high GPU Utilization?

    Hi, this isn't too much of a major problem, but I'm a bit curious what's happening here.

    I can hear a very high pitch sound come out of my Nvidia GTX 960 graphics card during fade transitions. (I must have super hearing :P ) I've heard this "sound" before when an old game (unrelated to Fusion) decided to go all out at extortionately high frame rates. I didn't hear or noticed this before with my GTX 650. (before it overheated some months ago, oops...)

    My project is using HWA (Direct3D 9) for the display mode. This happens whether V-Sync for the Fusion project is off or on. What's interesting is that this doesn't happen with Direct3D 8, but the frame rates are poor and jittery. Of course, the Standard modes utilises the CPU, so no problem there.

    When I watched the Nvidia graphics details while a fade transition (with Direct3D 9) was in action, the GPU Utilization jumped from 9% to 96% for its duration, then back down after it finished! The others: Standard = 15-30%. Direct3D 8 = 8-12%... but Direct3D 9 = ~96%, hence the pitched noise.

    Has anyone ever experienced anything like this? This could be due to external factors... like the Wine compatibility layer I'm using (translating to OpenGL) and/or the Nvidia driver itself, but for all I know it could be because fade transitions go "all out" as the frame/debugger "freezes" during a frame transition?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    573
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    First, make sure your GPU is clean! Take it out, give it a good dusting. Hot GPU's can cause a lot of unwanted effects.

    Second, there are more resource-light ways to handle fades. My personal favorite is the fade pixel.
    • Create a 1px by 1px Active Object, name it fade. Put it on the top layer, preferably by itself.
    • At the Start of Frame, set the X scale of the fade object to Frame Width, and the height to Frame Height. This will stretch it across the entire frame without taking up any more graphical resources than a single pixel!
    • Then, before your game code has started (trigger with a fast loop or with deactivating a Game group before the fade has finished), Compare two general values between your fade's Alpha Blending Coefficient and 255. If it is lower than 255, raise it by 1, 2, 3, etc. This will make the fade more transparent with every frame. Then when the alpha blending coefficient is 0, trigger the game to start.


    The beautiful thing about having a fade pixel instead of using transitions is that you can control it whenever you want, not just at the start and end of a frame, and you can make it do all sorts of things like blink or turn different colors. It gives you all the freedom to play around!

    Plus, the transitions are a very old feature. If all you want is a fade, it's best to go with a more customized, up-to-date, cross-compatible, resource-light, future-proof version like the fade pixel.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks... but it looks like I didn't make my point clear. I am aware of the "other" ways to create a fade, and the fact the transitions are ancient, but I'm looking to see if there's a reason why "Direct3D 9" would cause high GPU utilization (in which I can hear) or if it's Fusion's runtime or external software that causes this.

    It's not overheating the card - it's been idling for hours at 41░C with the CPU/System at 36░C.

    Nonetheless, your advice here will be useful for someone else still using the transitions feature.

    Maybe Yves or Francois might be able to chip in here: it's either how HWA is implemented that causes the card to go "all-out" during a transition, or it's caused by other software and not Fusion (like Wine, or the Nvidia driver)

    I did use the +fps debug flag in Wine, and it shows that... ha! I'm getting some beastly frame rates, which explains why I can hear this high pitch sound as the GPU Utilization % goes up.

    Outputs FPS every 1 second:
    60 → 58 →|→ 2048 → 2108 → 2235 → 2175 → 2253 → 1894 →|→ 189 → 60 →|→ 313

    I don't know if this "uncontrolled" FPS behaviour happens in Windows? (An external FPS monitor would be needed to check)

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    piscesdreams's Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    928
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Exactly what dsilvers said. The next best thing is a active object fade allows your game to not have the jarring pause effect when using the fade transition.

    But as far as why it affects your GPU in such a way, I could not say. Maybe Yves or Francois can shed some light.

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just tested this in Windows 7 too (same hardware) using GPUz to monitor the GPU Utilization -- it was up to 95-99% during a transition, similar pitched sound.

    It looks like Fusion's Direct3D 9 mode isn't optimised or limiting the frame rate for the legacy transitions, hence why it goes "all out". For a modern graphics card like the GTX 960, I guess I can hear it work harder than it needs to.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    573
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    What's probably happening here is you have an unoptimized feature, originally created as CPU-run code, trying to run on the GPU. You know how when you play a game with PhysX, but you're running an AMD card, it offloads the physics calculations onto the CPU? I'd guess it's something along those lines, but a lot more basic. It's Fusion offloading a CPU function onto the GPU, which it's not made for, but it'll do it anyway because by god you told it to.

    This is why you should abandon most of the functions built in since 1996. So much of the codebase hasn't been optimized because there are just so many alternatives, and also why Clickteam built Box2D alternates to the old built-in movement types (though to be fair, a lot of them still have their uses, just maybe not as they were originally intended).

    There's a lot in Fusion that's DIY, but a lot that's locked out. Transitions especially, though, since they happen in between frames and you can't control the code in them outside of their property windows, should be ignored. If you're getting 2048fps during a transition, that is something of a concern. Very simplified, in a game engine, there are routines and there are coroutines. Think of it as frontend and backend. Your coroutines help the main routines run smoothly, ie your CPU performs calculations (coroutines) so your GPU can render the results (routines). This was essentially the purpose of the original Hardware Acceleration addition in Multimedia Fusion 2. Instead of everything being dependent on the CPU as it had always been, some functions, draw calls in particular, were offloaded onto the GPU. If I had to guess, what's happening on your end is the GPU is running both routines and coroutines when the transitions are running, and yes, it's doing a good job (2048fps good) but it's not meant to. CPU code is meant to stay on the CPU, while GPU code is... eh, slightly more universal, as CPU's have been rendering information to monitors for decades. GPU's make the lives of CPU's easier, letting them focus on their backend while the GPU's make things visual.

    So, long story short, it's not worth worrying about. Like you said, that legacy functionality is not optimized for DirectX 9+.

  7. #7
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice explanation of some possible inner workings, thank you! It's technically a bug in Fusion, but I don't think it's worth reporting or fixing. As soon as Fusion 3 arrives, all of these legacy features that are so conveniently "there" will be gone and replaced with modern alternates that will sure keep modern graphic cards busy, but not overworked like here.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    573
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    It's funny how time in other engines can make you appreciate just how powerful Fusion is. It has this reputation of being overly simplified since you can't really hand-code anything, but the inner workings absolutely put it on par with, if not above, Game Maker Studio or Construct 2. Plus, if you dig deep into the math and do crazy trigonometric functions like I'm doing in my latest game, you might as well be hand coding. It's really the old K&P functionality that hasn't been cut that's holding it back, but at least it can be ignored.

    If the suggestions being mentioned in the Fusion 3 thread end up in the engine, and the price is right, it's gonna wreck the competition.

Similar Threads

  1. Fade transitions
    By Renatos in forum iOS Export Module Version 2.0
    Replies: 5
    Last Post: 1st March 2012, 02:38 PM
  2. Fade Transitions
    By loglady in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 12th August 2011, 06:59 PM
  3. Fade-in transitions
    By pikzilla in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th June 2009, 03:02 AM
  4. fade in/out transitions for sound?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th April 2008, 03:59 AM
  5. Bug with layer + fade-in transitions
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 1st July 2006, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •