How would you implement a "dripping smoke" shader like in DOTA 2

Discussion in 'Rendering Technology and APIs' started by cubrman, Feb 11, 2014.

  1. cubrman

    Newcomer

    Joined:
    Nov 16, 2013
    Messages:
    10
    Likes Received:
    0
    DOTA 2 has a number of interesting effects one if witch looks like smoke, dripping from a model. Watch it here (between 1:09 and 1:16):

    http://www.youtube.com/watch?v=b7TsYURjEos

    The smoke follows the model and leaves a trail in the air. I am wondering how they did both on the CPU and GPU side. I can imagine that they draw the 3d model first and then they draw a polygon on top of it to access the pixels that does not belong to the model. The pixel shader in the second step reads the positions of the model's pixels and draws dripping smoke via some combination of spritesheet texture lookup and coded logic. Other solution could be particles, but how do they know where to each individual stream of smoke? They might have some pre-set dots on the model though.

    Am I anywhere near correct?
     
  2. Colourless

    Colourless Monochrome wench
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,274
    Likes Received:
    30
    Location:
    Somewhere in outback South Australia
    Probably just a particle effect.
     
  3. corysama

    Newcomer

    Joined:
    Jul 10, 2004
    Messages:
    175
    Likes Received:
    122
    I expect it's a lot simpler than you think. There are animated sheets hanging from his arms. If they were solid textured, they would look like flags. But, they aren't solid. Instead, there are two smokey textures that are being mixed together to form the alpha channel used to blend with the screen. The UVs of the sheets are already wavy, but they are also being animated over time to make it look like the textures are sliding through the wavy sheets.
     
  4. Andrew Lauritzen

    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,526
    Likes Received:
    454
    Location:
    British Columbia, Canada
    Just a note... you can always capture a frame in GPA or similar and check it out for yourself :) But I suspect corysama is right... likely just some simple blended geometry with animated alpha.
     
  5. cubrman

    Newcomer

    Joined:
    Nov 16, 2013
    Messages:
    10
    Likes Received:
    0
    Thanks everyone for your replies.

    corysama, ok if they use polygons how does they make the smoke follow the wings when the model turns? Especially during the transformation animation? Maybe they animate the polygons (flags) togather with the model to make them follow it? In any case of you can think of a tutorial or an example where the approach you discussed was used, I would highly appreciate the link.

    Andrew, I tried to use Nvidia NSight for that, as I sucessfully did in Sait's Row 3. The problem is, DOTA 2 does not allow you to run it with an external program running in another thread. Once I launch the app, it starts with NSight monitor, but then it shuts down and restarts without it. I guess it's a form of protection agains cheating. Maybe GPA works differently from NSight?
     
  6. Andrew Lauritzen

    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,526
    Likes Received:
    454
    Location:
    British Columbia, Canada
    Probably. I've used it in the past to profile DOTA2 I believe, so give it a try.
     
  7. corysama

    Newcomer

    Joined:
    Jul 10, 2004
    Messages:
    175
    Likes Received:
    122
    The "flags" are using some sort of dynamic or baked cloth simulation so that they move like flags. That effectively drags the smoke along with the arms.

    Here are a few examples of UV animation I found with a quick search. From least to most complex:

    http://hewiki.heroengine.com/wiki/Animated_UVs_Tutorial This will look like a swirly, animated streak. But, the mesh geometry is completely static. The texture will travel along the static ribbon like it's riding down a highway.

    http://cgcookie.com/blender/2013/12/05/tip-animating-uvs/ I'm pretty sure the mesh here is static too. But, they are scrolling a displacement map across it.

    http://www.oztalay.com/matt/tutorials/flaming-rainbow-material-udk/ Here they are using a noise texture to add detailed displacement to the individual texel UVs. The noise is scrolled smoothly and use to displace the rainbow noisily.
     
  8. cubrman

    Newcomer

    Joined:
    Nov 16, 2013
    Messages:
    10
    Likes Received:
    0
    Andrew, unless I am doing something wrong, the good days are gone now :). I launched our game with GPA and could successfully capture a frame and profile it, but when I did the same with DOTA 2 - it started properly, showed me the infamous headvalve screen and then restarted without the monitor :). The thing is, you cannot even find the .exe file that actually launches the game. And when you do find it (via the Task manager), it always starts the game only to shut down after the valve screen to be restarted with some magical script that finally gets the app beyond that screen. I don't have a perfect understanding about how apps are launched in Windows and my quick Google search yielded no results, so I am quite cornered here :).

    cyrosama, wow, never even thought that was possible, that's quite a topic for me to discover! Thanks!
     
  9. karlotta

    karlotta pifft
    Veteran

    Joined:
    Jun 7, 2003
    Messages:
    1,292
    Likes Received:
    10
    Location:
    oregon
    Steam overlay? Your Steam games are in the Programs folder?
     
  10. cubrman

    Newcomer

    Joined:
    Nov 16, 2013
    Messages:
    10
    Likes Received:
    0
    Yes, if you mean Program Files. They are located at D:\Program Files\Steam\steamapps...

    If there is now way to capture a frame for profiling without running the game with the monitor turned on, I don't know how one can profile DOTA 2.
     
  11. cubrman

    Newcomer

    Joined:
    Nov 16, 2013
    Messages:
    10
    Likes Received:
    0
    I was able to profile DOTA 2. If anyone stumbles upon this, you just need to enable "autodetect launched 3D apps" in GPA Monitor Preferences. Thanks everyone for your help.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...