Home Technical Talk

3D Studio Max gradient opacity on particals kills render time.

Title says it.
I'm doing an animation where my character is holding a smoking fan. I am trying to use a super spray particle generator with a gravity binding to get the smoke. Everything prior to the smoke renders in about 1 minuet, but as soon as the first frame of the smoke pops up the renders rocket over half an hour per frame.
When I turn off the opacity map to the smoke particles it renders fine, but then it just looks like gray squares.
The smoke texture is just a simple standard material dark gray color, the opacity map is just a radial gradient.

Anyone know what would cause this and how to fix it?

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    a few hndred thousand alpha tests and gathers causes this.
    IE partly transparent particles take a long time with a scanline renderer.

    The way to get around it would be with hard edged transparency, so you either see the particle or don't, but that will, of course, kill your soft smokey look.

    Other options:
    Upgrade your processor
    Use fewer particles.
    Render the particles in their own scene then composite them into the first render set with afterfx or a similar program
    create your particle effects in a 2d program like particle illusion, render that out, composite with 3d render.
    Render your particle effects in a 3d engine and accept the slightly lower quality, then composite as previously mentioned.

    Really, if you're doing offline rendered stuff, its good to get really familiar with a non-linear editor and compositing program, ala AfterFX and Premiere, or Avid, or FinalCut.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Why not render out particles in chunks and then combine them in post?

    If they're not wind/environment interactive, with collision and such, it will save alot of time in to render a couple of sets of them, and process them in post. You could even use mutiple layers of the same smoke to save time by rotating and positioning them cleverly.
  • monster
    Options
    Offline / Send Message
    monster polycounter
    After Effects has an awesome particle fx system. I had to do a scene of a door exploding. All the flames, smoke, and dust were done in there. Saved a lot of time.
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Totally Add Particular to AE and your set
  • Mark Dygert
    Options
    Offline / Send Message
    Yea "do it in post" its the easist and fastest way.

    If you're set on doing it all in the scene here are some things to try:

    - When rendering, geometry will always be faster than complex opacity shaders.

    Vailias touched on this and I explained it in a bit more detail HERE. But basically rays are shot out from the camera/viewport when it finds something it reports back what color it found, which is easy for something solid. For every transparent pixel the render finds it has to figure out what was behind it, if it finds another transparent pixel, that calculation gets put on hold until it figures out the color of the pixel behind it, it has to keep putting these calculations on hold until it runs into something solid. Then it works its way back through all the transparent pixels.

    Add to it that if you want your shadows to accurately show what is in the opacity map instead of the actual big blocky geometric shadow its going to need to run through another long series of calculations. At that point your better off turning off shadow casting and faking the shadow with some geometry that doesn't render but casts a shadow.


    - Make sure your planes are trimmed tightly to the opaque part of the material.
    If you have giant planes that have large sections that aren't doing anything trim them down to cut down on the number of pixels the render-er has to stop and think about whats behind it. Even if the pixel is 100% transparent it still stops and goes through the long "whats behind this" process.
    OpacityPlanesAlphaSorting.gif


    - Your system can handle more geometry/particles if they are 100% opaque.
    So think about using thousands of tiny particles that aren't transparent, instead of a handful of giant planes with opacity.

    Believe it or not the effect on the right will render faster, actually have volume and cast more accurate shadows, faster than whats on the left.
    You'll probably want to use smaller particles and more of them in your final effect but this gets the point across.
    ParticleOpacityVsOpaque.jpg
    The method on the left will also cause problems with fog and other effects that don't take the opacity into effect and reveal the blockiness of the planes. In those cases you end up having to do several passes and composite them together... which is a pain in the ass.
  • Alidium
    Options
    Offline / Send Message
    Thanks a lot for all the input I'll come back with results later.

    Although why is it that in many games the fire or smoke partials appear to use a few large particles rather than a bunch a small one if its faster? Do those particles not use an opacity map on them? I'm just going off observation.

    One more thing. I only just started posting here. Is there a way to not automatically log out every 5 minuets?
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    Games generally don't have 100 planes stacked on eachother for a smoke cloud, but only a dozen or so.

    When logging in there should be a tickbox 'keep me logged in'.
  • Mark Dygert
    Options
    Offline / Send Message
    Alidium wrote: »
    Thanks a lot for all the input I'll come back with results later.

    Although why is it that in many games the fire or smoke partials appear to use a few large particles rather than a bunch a small one if its faster? Do those particles not use an opacity map on them? I'm just going off observation.
    When I say geometry will always render faster, I'm not talking about realtime engines. Games are a lot different than rendering, in realtime engines they have different methods that are technically less accurate but are much faster.

    For example a realtime engine might only go 1-2 planes back before reporting back the color of the deepest pixel, "Is the pixel behind it 51% transparent? Yes. Good enough they're going to be shot in the face anyway so who cares". Where a render engine will go a lot deeper and spend a lot more time figuring it out exactly what color the pixel will be even if it doesn't change noticeably. It's focused on accuracy not speed.

    Realtime engines also have things compartmentalized to speed things up. So certain things they know will cause long calculations are excluded. Grass and other transparent materials, or far off distant buildings, might not be drawn through smoke.

    Like it was talked about a bit earlier, there is a difference between Alpha Test(fast) and Alpha Sort(Slower), in rendering all you really have is alpha sorting unless you string some pretty serious hacks together when rendering, and then accuracy goes right out the window. Most engines like UDK default and process opacity textures to be alpha test unless you specifically flip a few switches to force longer calculations.

    Some engines will detect a transparent material behind another and flip the backmost to alpha test so it returns a solid color faster.

    Some engines resolve what can be seen on the object level before going down and sorting transparency.

    Some games might do some tweaks to the opacity map to make sure pixels fall into certain tolerances. If a pixel is 5% transparent, treat it as 0%, process all 0% pixels quickly with no sorting.

    With both rendering and realtime the less stacked planes and the less semi-transparent pixels you have the faster it's going to resolve.

    I'm sure there are more programer/tech heavy answers out there if you really wanted to dig into the difference but those are the ones I remember from when I dug into the subject.
  • Alidium
    Options
    Offline / Send Message
    Very helpful Mark. So far removing the opacity and having thousands of small particles seems to be working. Trying to get it to look more smoke like now.

    I will post pictures as soon as i figure out how.
  • Mark Dygert
    Options
    Offline / Send Message
    Allan McKay has a good tutorial about creating cigarette smoke.

    http://www.allanmckay.com/site/index.php/legacy-tutorials
    (toward the bottom)
Sign In or Register to comment.