Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Automatic imposter system to significantly increase frame rate and visual fidelity

Discussion in 'Wish List' started by I am da bawss, Jun 20, 2011.

  1. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Imposter System (rendering 3D geometry to sprite at runtime) – it will speed up the frame rate and visual quality dramatically because distant 3D object do not change angle from viewing angle (in view) dramatically. So in theory you can render a very detail truck to sprite at runtime and animate it along the screen and only update infrequently – and it won’t change much and yet provide very high visual fidelity.

    This is an explanation and source code to a OpenGL based Imposter class
    http://troylawlor.com/tutorial-imposters.html

    This is another discussion about designing the imposter system
    http://www.gamedev.net/topic/378341-imposter-system-design-problem/

    What’s interesting about this one is that he is packing each imposter texture into a large atlas texture, so that he could skip huge amount of texture binding calls when rendering the imposters.

    Then he added frustum culling to cull out groups of imposters, instead of each one individually. Then instead of updating imposter textures every frame, he only update them every 30 frames or so. There isn’t any visual difference. This boosted frame rates by another 200-300 fps depending on how many imposters are in view.

    Then he created a load balancing system that only updates a certain number each frame, instead of every single imposter that needs updating. This increased the fps by about another 100fps.
     
    Last edited: Jun 20, 2011
    Gua likes this.
  2. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    I would imagine this to be quite a performance boost (up to 1000x!) to the Unity Engine. I really hope the UT developers (Aras?) sees this post! :)
     
    Last edited: Jun 26, 2011
  3. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Nobody interested in this ?
     
  4. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    This would be bad ass in a good way. +1
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Huh....Isn't unity Terrain Engine already used this for Tree LOD....? CMIIW
     
  6. twitchfactor

    twitchfactor

    Joined:
    Mar 8, 2009
    Posts:
    356
    Maybe if you let people know that Donkey Kong Country Returns for the Wii does this on the characters... then maybe people will be interested? ;)
     
  7. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Donkey Kong Country Returns use imposter system? I didn't know. But it sounds like its perfect for it too since its platformer, the camera angle doesn't change much. In the past they use all pre-rendered sprite and it works great too so it makes sense to use imposter system.

    I think this system will benefit almost every types of game, be it top down RTS, side scrolling platformer or even FPS / TPS (third person shooter).

    Also, if you guys like this idea please vote for this feature too! :D

    http://feedback.unity3d.com/forums/15792-unity/suggestions/1947435-imposter-system
     
    Last edited: Jul 17, 2011
  8. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574

    I don't think so.....(or maybe it does?) its certainly not in Unity documentation and isn't expose to the user.

    I would like to be able to use it so distant objects (be it trees or user created art assets such as buildings/cars/characters/debris/clutter) would automatically be rendered to imposter sprite and update only periodically so more CPU/GPU resources be dedicated to more important tasks.
     
    Last edited: Jul 17, 2011
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well imposter's been around for a while. On some devices it will be slower to use an imposter than it is to just use a final lod of very low detail. Imposters suit different things but trees are pretty ideal as decimating tree detail in the distance has fairly bad effects.
     
  10. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574

    I believe imposters would be great to use on almost any situation - because you are essentially rendering a quad (2 triangles) - the lowest LOD models can't be lower than a quad (than it would be an imposter). And if you instance all your objects it will be even faster - the system only need to render the same object once in some instance as long as angle doesn't change between the objects (trees are perfect example).
     
  11. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Technically, I don't think this is hard to do - using Render to Texture you can already do it - the trick is to do it extremely fast and at system level of optimization.

    I think this can be a nice Pro Only feature - because it access Render to Texture and also it gives a huge incentive to those people who pays for the Pro license a nice big speed boost just like Umbra Occlusion Culling gives to Pro licensees.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It will help to list a set of strong cases it can be used in everyday games. Trees are the obvious one, but what else? I notice unity are working on an improved lod system right now according to their blog. So perhaps this is the ideal position for this code, as the last level of lod, the optional billboard level. It would also update every x frames as well, in case the far distant object is turning.

    You'd just allow the last level of lod to be billboarded and give it an update rate. This is a fill-rate problem though for some devices. It's faster for ios for example, to render a slightly higher poly mesh, say 50 polys than it is to render a similar area with transparency, because the fill rate is an independent bottleneck to the vertex pipeline.

    I am all for it of course but only if its neatly slipped into the lod system they're planning for a nice graceful fallback. I would probably use it close up too on super-high polygon objects so that I am only rendering one super high polygon object that is moving at a time... a lot of inventive uses for saving rendering times close up, particularly if they don't animate or turn fast but do need to be 3D.

    I can do that right now with RTT, but its always nice if the pro's deal with it better than I do.
     
    Last edited: Aug 24, 2011
  13. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Yeh exactly, I have been saying that for a while, I had suggested it should be integrated into the LOD system as the last level, and you are also exactly right that it would ideally suited for desktop, but not mobile devices. But it is still a solid performance upgrade if UT could integrate this feature into future Unity.

    As for what circumstances it should be use - if I am not wrong, I remember True Crime - New York did used imposter system (there was an in-depth article about it on Gamasutra years ago but I can't find it now....) on the props eg. cars, pedestrians, street lights etc etc.

    Jurassic Park: Trespasser is another famous example which pioneered the use of it - practically every objects was "impostered" - at fairly close range too largely due to the lack of 3D processing power at the time and the side effect was very noticeable as objects "pops" into existence from 2D to 3D at close range.

    Since it would work the best when view isn't changing - I think background scenery would be another great one to use such system - mountains, hills, distant island...etc. Think of distant mountain and islands in Crysis - As long as perspective don't change dramatically every frame, then there is a good use for it! As matter of fact - I think Half-Life 2 use imposter on its 3D 3D Skybox/background - it renders distant mountains and scenery from real 3D but only update it irregularly and in low resolution.

    There are probably millions of other games where imposter was done right, but you wouldn't know about it because its done right! (the transition from 2D to 3D would be impossible to detect with naked eyes if you tune it just right)
     
    Last edited: Aug 24, 2011
  14. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    As you pointed out, this was more commonly used when hardware was a problem. Now it's only used in isolated situations: many of same item on screen at once, not taking up more than 5% screenspace, and not moving. That leaves vegetation. Many of the games you mention use artist created billboards, which are quite different and can be done far more efficiently. The case for imposters is further weakened by the common screen resolutions we have today.
     
  15. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Hardware limitation is still a factor for mobile devices. So this feature is still highly applicable for a lot of platforms.

    Also, there is never enough for optimization! If I can imposter my backgrounds whenever I can, even on desktop that's a huge saving!

    There are many things other than the trees that can be imposter - buildings, smoke columns, even NPC/cars/birds, street lamps etc etc. For example, with proper imposter system, you can have a much larger crowd of angry mob than if you go the traditional instancing route.

    And about the screen space and resolution - let's take Half-Life 2's Combine Tower for example - its a massive structure that takes up a lot of screen space, and yet its stationary and does not change much perspective wise - perfect for imposter system. There are a lot more entities that can be pushed to the imposter in my opinion and updated irregularly which would hugely improve the frame rate of the game, and give you more polygon budgets to the foreground objects.
     
    Last edited: Aug 29, 2011
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Mobile devices are generally starved for fillrate, so I don't really see this benefitting anything. This is old tech anyway, polycount problems are more or less gone these days, even on ios, at least with a half decent Lod system.

    Edit: (also, using trespasser to prove a point is a bad idea :p )
     
    Last edited: Aug 29, 2011
  17. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    HAH! I don't believe this, I actually found that article again!

    Dynamic 2D Imposters: A Simple, Efficient DirectX 9 Implementation

    "The technique of using 2D imposters is becoming more and more popular in the world of computer games. The aim is, without loss of detail, to reduce the geometric complexity of a 3D scene by caching portions of the scene as images. 3D objects in the scene are captured into separate images. When the final scene is generated the cached images, or imposters as they are known, are rendered in place of the 3D objects. In this way an imposter is a simplified representation of a complex 3D object. As modern games grow larger and demand more detail than ever before developers are increasingly looking for new and innovative level-of-detail algorithms. The common place practice of using a progressively lower detail series of hand-authored meshes is not necessarily enough to meet the demands of modern games and more advanced solutions such as 2D imposters are required. As the topic of imposters is gaining acceptance and importance in the industry, numerous good articles and chapters have already been written, however I have not yet seen an article that covers the implementation of an imposter system. This article provides some basic theory, but is mostly concerned with, as the title suggests a simple and efficient system for dynamically generating and rendering 2D imposters.

    Imposters can be used in many situations, however they are very well suited for complex and detailed games that have a large amount of distant static background geometry. In these games the users' attention is likely to be in the foreground and they will not notice the imposters in the background. Less time spent processing and rendering geometry leaves the game more time for the things that really make the game: logic and AI."



    Figure 1. Screenshots from Tycoon City: New York. A modern PC game that is due for release in early 2006 and simulates has a detailed city environment. Far-left has no imposters. Middle has barely noticeable imposters in the background. Far-right shows imposter outlines.

    http://www.gamasutra.com/view/feature/2501/dynamic_2d_imposters_a_simple_.php?print=1
     
    Last edited: Aug 29, 2011
  18. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    This would be of course marevelous fetaure. Btw, Torque has this for some time. Actually we were already thinking to write such system by ourselves, because it would be great performance boost.
     
  19. MrBurns

    MrBurns

    Joined:
    Aug 16, 2011
    Posts:
    378
    Yeah like the "Battlefield 3" console demo video, where the billboards jump right into your eye ;). Great step forward!
     
  20. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    326
    Fun Fact: Second Life uses Impostors for rendering *people* of all things. Details here.

    Basically, every texture in Second Life is one someone uploaded, and every object and avatar in the game (other than terrain textures,) is cobbled together by a user, so traditional optimization techniques like atlasing or even planning how many textures get sent to the GPU pipeline are all laughably naive. Optimization assumes that there will always be way too many textures for the end-user's computer to render optimally, and works around it as intelligently as possible.

    The problem gets worse when you realize that Second Life is a *social* game, and users tend to congregate in one spot for dance parties and the like. So now you've got 50 highly customized avatars with custom animations playing. Surely this is the worst possible thing to try and simplify with impostors, right?

    Well, that's the thing. Once you accept the premise that there's inevitably going to be significant client-side lag at a party, it becomes a question of how to best dole out rendering resources to each costly avatar. In a best case, you're at a party with like 50 people, you actually lag more when zoomed in on one of them, because if you zoom out for a view of the entire dance floor at once, everyone's an impostor.

    Oh, sure, each individual avatar might appear to be animating at 10 or 15 frames per second and out of synch with each other, but that's better than rendering all 50 avatars with custom textures every frame and getting less than one frame per second.

    Naturally, this won't be optimal on all PCs, let alone all devices, and so like all good optimization techniques, the end user has the option to turn it off in a fiddly graphics settings menu.

    I'm going to just say it: This feature would not be useful for mobile developers, therefore it is not likely to get resources thrown at it.
     
    Last edited: Apr 1, 2013