Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[RELEASED] Imposter System OPTIMIZATION

Discussion in 'Assets and Asset Store' started by MUGIK, Aug 18, 2016.

?

Are you interested in this project?

  1. Yes.

    99 vote(s)
    91.7%
  2. Maybe.

    9 vote(s)
    8.3%
  3. No.

    0 vote(s)
    0.0%
  1. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    I understood for "cube" in "House_1" prefab.

    I checked isStatic to "false". I have "billboardRender" layer But I didn't change the layer of the prefab to this layer.

    Now I change the version to 2017.3.0f3 Result same way. It's work well in unity editor but It doesn't work in build(window platform)

    Please help me. Thank you

    Edit more information
    I try create new BillboardController by 3 cube colors.(near-green, mid-yellow, far-red<billboard>)
     

    Attached Files:

    Last edited: Jan 4, 2018
  2. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Very strange problem. I tried it for myself with same settings as you and it works fine. Can you send me your full test project, please?(Assets and ProjectSettings folders) You can write to me at doterpoter@gmail.com or leave it here.
     
  3. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    I sent you a mail. Thanks
     
  4. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    I found solution, just need to change folders hierarchy
    from:
    upload_2018-1-4_19-33-56.png
    to:
    upload_2018-1-4_19-35-8.png

    Problem was that shaders were not included in build. Unity always love changing some core mechanics=)
     
  5. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    Wow! If this work in old version you should update on asset store. Thank you very much :D
     
  6. p7161

    p7161

    Joined:
    Jan 7, 2015
    Posts:
    4
    Looks very promising, but i noticed massive perfomance drop in trial version, when you rotate camera pretty fast or change FOV (right click). No matter in editor or build.
    Is it happens in trial only? Otherwise, this system is not applicable in production.
     
  7. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Yes, its because system needs to recalculate massive ammount of billboards. In BillboardsHandler settings you can specify how many billboards can be created per frame.
     
  8. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110

    Changes:
    • fixed probem with shaders in build via replacing 'BillboardSystem/Shaders' folder to 'BillboardSystem/Resources/Shaders'
    • added automatic disabling 'allowHDR' on billboardCamera for Unity 5.6 or newer
    • removed TextureController from BillboardsHandler
    • add field BillboardsHandler.disableBillboardsUpdating
    • changed name and logic of BillboardController.errorScreenSize to 'errorDistance'
    • add queue type 'SortedByScreenSize'
    • optimized algorithm of creating billboards mesh
    • fixed preload factor for VR projects
    • rename 'BillboardHandler' to 'BillboardsHandler'
    • changed BillboardsHandler.fadeTime default value from 0.5 to 0.2 and range from (0.1, 3) to (0.05, 1)
     
    Last edited: Jan 10, 2018
    AthrunVLokiz and blitzvb like this.
  9. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    356
    To be honest, the first time I saw this thread, I thought its a better billboard system for particles and stuff.
    I never bothered to click on it, until I misclicked, discovered that its an imposter system, and immediately subscribed.

    The screenshot in the asset store also isn't helping at all.

    I suggest a name change, I am interested in a better Imposter optimization.

    I am curious about the feature shown on v1.4, Terrain-like billboards? does that mean it will work for Unity Terrain?
     
    blitzvb likes this.
  10. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Same here. What do you in plan for terrain?
     
  11. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    No, I mean one billboard texture for every instance of prefab, like terrains tree billboards. Would be helpfull for landscapes that made without unity terrain.

    There is no way to combine terrain trees and BillboardSystem because its impossible to add components to this trees during unity terrain limitation. One way is to remove all trees from terrain on startup and replace them with object instances with BillboardController component. I dont think its good idea=)
     
    blitzvb likes this.
  12. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    200

    Pretty awesome, this is running on integrated Intel HD Graphics 2500.
     
    Last edited: Jan 19, 2018
    hopeful, MUGIK and blitzvb like this.
  13. dozhwal

    dozhwal

    Joined:
    Aug 21, 2014
    Posts:
    44
    hi. i tried your asset some monthes ago. and it tried to use it with some LOD makers (simple LOD, meshbaker LOD) and it didn't seems to work well. i tried to replace the "culled" state with your billboard but it didn't worked. any idea how it could be possible ?
     
    blitzvb likes this.
  14. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    BillboardController component is not a renderer, its more like LODGroup, so you cant use it with other LOD systems. But you can use meshes, created with SimpleLOD to work with BillboardController
     
  15. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    with a SimpleLOD workflow, what would be the advantage compared to a regular billboard that I create myself?
     
  16. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    200
    It actually looks 3D instead of a flat plane because the billboard is rendered at multiple angles and rotated correctly at all times.

    Similar to Doom's enemy rendering, just in a higher quality.
     
  17. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Hi!
    I'm working on new feature: Imposter Shadow Casting
    Let me know, what you think about that. Any suggestion?
    Please, enable subtitles on video
     
    blitzvb, AthrunVLokiz and Gekigengar like this.
  18. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    I think for this is the best function for billboard system. And, No one has. People need object's shadow in their view. However, nature billboard couldn't. I must tell you again "This is big deal"(for me).

    Question
    1.Can we increase Atlas Resolution? If possible. How much does it affect fps or RAM?
    2.I encounter a little problem. When the object in billboard system behind my cc. It disappears right?(because culling or LOD's function when it is not in camera view) But I should see this's shadow. And Now, We have billboard's shadow caster. Can you help me?

    Thank you. My Regards
     
    MUGIK and blitzvb like this.
  19. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    It’s a big deal. Clearly.
     
    MUGIK likes this.
  20. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Generally you can use field 'Atlas Resolution' at BillboardHandler. If you want more than 2048, then you can simply edit enum in source code to something like
    Code (CSharp):
    1. public enum AtlasResolution{
    2.         _512x512 = 512,
    3.         _1024x1024 = 1024,
    4.         _2048x2048 = 2048,
    5.                 _4096x4096 = 4096 // new one
    6.     }
    Sorry, I didnt get it:)
    You mean that we must see shadows from billboards, that is invisible for camera? Its a good remark, need to think about that. If I misunderstood you, then correct me, please.
     
    AthrunVLokiz likes this.
  21. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    Good, And that shouldn't over 8192x8192.


    -object's shadow that behind character controller.
    -when character look down to the ground(top view) then a billboard rotate for LookAt the camera.
    (maybe that's my problem only.)

    thanks for replied.
     
    blitzvb and MUGIK like this.
  22. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    hey,

    is it possible to use your system for a far view only and when the camera move closer switch to 3D? you were mentioning simpleLOD earlier but I am not sure how it helps.

    I also saw in your last video, that you can switch on and off, the imposter system... is the full mesh still in memory?

    thanks in a advance and please continue your awesome work!
     
    Last edited: Jan 29, 2018
  23. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Really seriouse problem! Thank you for pointing me out. Will be fixed in next release.
    Not only your problem:) I trying to fix that but for now didnt find solution.
    This is error in calculation accuracy, for now you can try to disable 'Always look at camera' at BillboardController component.
     
  24. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Actually, thats how it works:D
    I mentioned SimpleLOD because you can use BillboardController component as LODGroup, and create several level of details thats shows 3D objects.

    Emmm... Yep)) Need to fix that.
     
    blitzvb likes this.
  25. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    It would be nice to have an option so we can adjust depending on the situation.

    Thanks you so much for your answers. It’s in the cart ;)
     
  26. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    So what kind of control you expect?
     
  27. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    keep it in memory or not.
     
  28. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    For object's shadow where behind camera and rotate when top view problem
    -I guess that if you add a separate system to work together with the BillboardLOD(in BillboardController), The new system should check that the object is away from the camera with the 'CameraDetector' component in the x and z dimension.(ignore y) for show LOD0 or show billboard by unable 'Always look at camera'.

    But It maybe affects to performance a bit because we add more condition before render.
    P.S. I try to read your code for find solution but I don't have enough skill. I confusing with your system part of show LOD level. :( my bad.
     
  29. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Hi!
    List of bugs and suggestions is empty!:cool:

    That's what will be in next release(for now):
    v1.2
    Important:
    - asset name changed to 'Imposter System'
    - a lot of code was refactored, that's why there might be problems with upgrading to new version of asset
    - Imposter Shadow Casting - new feature
    - improved imposter fading: now based on pixel screen position
    - add enum UpdateBehavior on ImposterController

    Fixes:
    - internal system bugs are fixed
    - fixed shadow distance when render shadows to imposter texture
    - deleting mesh when deleting atlas
    - deleting atlas when it is empty
    - deleting BillboadTexture when atlas is deleted
    - max atlas resolution up to 4096
    - casting shadow from 3D objects that are behind camera
    https://forum.unity.com/threads/released-billboard-system-optimization.426478/page-3#post-3371826
    - shader problem: when camera is above billboard it makes billboard to rotate
    https://forum.unity.com/threads/released-billboard-system-optimization.426478/page-3#post-3371826

    If you have any problems or suggestions, its time to say it!

    Also, you can be beta-testers and check your previous problems before release.
    For that, contact me at doterpoter@gmail.com with invoice number.

    Cheers!:)
     
    Last edited: Jan 31, 2018
  30. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    yeah! :)

    And the name is much better.
     
    Last edited: Feb 1, 2018
    Gekigengar and MUGIK like this.
  31. AthrunVLokiz

    AthrunVLokiz

    Joined:
    Jun 7, 2017
    Posts:
    17
    If using simple name of the system that means this is a standard system. But I don't think so. This asset should be the epic name or unique name. Good luck, For epic update. :D
     
    Gekigengar and MUGIK like this.
  32. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    HIGH RES Large Key Image 2.jpg
    Imposter System v1.2
    Now avaliable on Asset Store
    Important:
    - asset name changed to 'Imposter System'
    - a lot of code was refactored, that's why there might be problems with upgrading to new version of asset
    In docs you can find steps to upgrade from old BillboardSystem
    - Imposter Shadow Casting - new feature
    - improved imposter fading: now based on pixel screen position
    - UpdateBehavior of imposters
    - Added using Profiler

    Fixes:
    - critical internal bugs are fixed
    - removed warnings and depricated methods for new versions of Unity
    - fixed shadow distance when render shadows to imposter texture
    - deleting mesh when deleting atlas
    - deleting atlas when it is empty
    - deleting BillboadTexture when atlas is deleted
    - max atlas resolution up to 4096
    - fix example scenes and new UI settings
    - casting shadow from 3D objects that are behind camera [https://forum.unity.com/threads/released-billboard-system-optimization.426478/page-3#post-3371826]
    - shader problem: when camera is above billboard it makes billboard to rotate [https://forum.unity.com/threads/released-billboard-system-optimization.426478/page-3#post-3371826]
    Social Media Image.jpg
     
  33. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Congrats for this latest version!

    Beside bugs report that I sent via email, I have a problem when I disable billboard update, as all object continue to rotate when I move horizontally.

    How can I do to stop this rotation? I tried to put false in LookAt but it’s still rotating.

    Ideally what I want to do is to generate the billboard at runtime of a mesh, render it for the camera and do not update or touch it when I am moving the camera. For a rts like I think it could work.

    Thanks in advance
     
  34. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    When you turn off LookAtCamera? At edit mode or at runtime?
    At runtime it doesnt work, but if you made changes on prefab it will work.
     
    blitzvb likes this.
  35. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    hey,

    All the following is at runtime.

    - 1. when I start with disable imposter updating checked, and add game objects, some are not rendered. see in the following screenshot:

    Capture-imposter.PNG
    I think imposter system do not run at least one render in that case.

    - 2. even when

    public bool alwaysLookAtCamera = false;

    imposter are still rotating, not much but they are. see in the following screenshot:
    Capture-imposter-stillrotating.PNG

    Step to reproduce :

    - elevate your camera to a view like in the screenshot.
    - enable imposter system
    - disable update
    - move horizontally the camera

    thanks in advance.
     
    Last edited: Feb 12, 2018
    MUGIK likes this.
  36. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    On the other hand, draw call and nb of vertices are really dropping thanks to imposter system!

    Imposter system disabled:

    Capture-vertices-disabled.PNG

    Imposter system enabled:

    Capture-vertices.PNG
     
    Last edited: Feb 12, 2018
  37. christoph_r

    christoph_r

    Joined:
    May 20, 2013
    Posts:
    398
    They're dropping from ~6 million to around 7 thousand? That's quite a bit of a drop in my books?
     
    blitzvb likes this.
  38. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Lol indeed ;) I missed the M ;)

    I updated my last message.
     
  39. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    356
    I was about to purchase, but there is a review saying that it comes with its own editor settings?
    Has this changed since then?
     
    MUGIK likes this.
  40. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Yes this is fixed.
     
    MUGIK and Gekigengar like this.
  41. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Yes, this is fixed. But anyway, do not forget to backup your project!
     
    Gekigengar likes this.
  42. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Yes, this is expected behavior. Maybe I named field incorrectly... It most like disabling camera processing, so you still able to see imposters, but no calculation is occurs. 'Disable Imposters Updating' is most useful with UpdateAllImpostersImmediately(): you can call it when level is loaded or camera immediately changed location like in VR, and then disable this toggle. So calculation would occurs only once

    Cant reproduce...Here is video
     
    blitzvb likes this.
  43. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    And if you would use Imposters render type: DrawMesh, then you can achieve less than 10 drawcalls in this case :)
     
    blitzvb likes this.
  44. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    ok I am able to reproduce it and only in draw mesh. Do the same steps you did in the video but with draw mesh and it will rotate.

    On another subject, I am trying to use the imposter system with procedural generated mesh so I cannot set any renderer in the Imposter controller prior to be already in runtime. how should I do that?

    thanks in advance.
     
    Last edited: Feb 16, 2018
  45. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    I did the same steps as in video with DrawMesh - nothing changed, still no rotation...:confused: Did you disable 'Always Look At Camera' on prefab?
    You have access to the levels of details: ImposterController.m_LODs and ImposterLOD.renderers. You can manually set array values or use methods Add and Remove from new ImposterLOD.cs that attached to this post.

    UPD:
    Code (CSharp):
    1. //adding
    2. imposterController.m_LODs[indexOfLOD].Add(newGameObject.GetComponent<Renderer>());
    3.  
    4. //removing
    5. imposterController.m_LODs[indexOfLOD].Remove(gameObjectToRemove.GetComponent<OriginalGOController>());
     

    Attached Files:

    Last edited: Feb 17, 2018
    blitzvb and AthrunVLokiz like this.
  46. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    yes.

    I will test again as soon as I will integrate the Imposter System to my project.

    cool! Thanks for your great support.
     
  47. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    605
    Hi, I am very interested in using this asset in a racing game I am working on.

    Does anyone know if it works ok with the Amplify Motion asset?


    Many thanks in advance!

    Greg
     
  48. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    110
    Hi
    If what they said is true "Amplify Motion is a complete and fast full-scene vector based motion blur effect that works with all opaque, coverage and alpha-test surfaces", then it would work with Imposter System.
     
    Greg-Bassett likes this.
  49. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    605
    Thanks for fast reply! That's great news!

    I am just trying out the demo version, will let you know how I get on! ;)
     
  50. Greg-Bassett

    Greg-Bassett

    Joined:
    Jul 28, 2009
    Posts:
    605
    I am receiving a few errors in the console? I am looking at the example scene, I see the houses in the GameView, but not in the Scene View when the scene is playing in the Editor?

    And I get the following errors:-

    MissingFieldException: Field 'UnityEditor.PreviewRenderUtility.camera' not found.
    Matrix stack full depth reached


    Any ideas?