Search Unity

Amplify Impostors - Next Generation Billboards

Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Jul 10, 2018.

  1. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389

    Hey there,

    Was the first shot taken after importing the URP Impostors package? There's a Magenta mesh there which is a bit unusual.

    Please try changing the shader on the mesh to the Standard URP, just to be sure that it's actually baking.

    What exact Speedtree shader are you using on the grass?

    Thanks!
     
  2. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    So I was looking into a real time LOD generation system but I don't like the traditional techniques because I have to put many game objects in the scene which adds too much memory overhead and makes the scene messy so I am looking for easy alternative that is quick to implement and I want to make objects in the background replaced by realistic LOD.

    Some questions:

    1.Does it support HDRP?

    2.I was wondering if I had a hundreds of blades of grass but they all the same model of grass just put around the scene can I just select them all and click a button and have the plugin fix it so that it will do the math and change any grass that is at certain distance to imposter? Because I don't think I can manually select a hundred blades of grass and for each one make an imposter that would take hours, so if I make 1 imposter is it reusable if I duplicate the grass or use it to pain terrain (I don't use terrain but just in case).

    3.The other question is about mesh complexity and number of prefabs say I have a very dense geometry house that is made up of 1 million vertexes and many prefabs can I just select the house (lets say 50 prefabs make the house) and will your plugin make 1 imposter that turns off all of those prefabs at a certain distance and replace them with the imposter?

    4.What can the LOD system do and what can it NOT do like some extreme cases or rare cases.

    I know they kind of the same question but I want to be sure.
     
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there!

    To be clear, Amplify Impostors does have a trade-off in which you add to the GPU memory use.

    1. Yes!

    2. No, ideally you would only change the hypothetical blade of grass prefab which would then update all other blades of grass for you. That said, always consider if the original object is not lighter than the actual impostors; a single Quad blade of grass is not a good candidate.

    3. That would be unpredictable but you'd likely waste a lot of resources as the resulting bake would probably only show you the outside of the house; you must bake Impostors individually. However, it does support multi-object baking. High poly models and high amounts of materials are totally fine.

    4. In regards to what exactly? Impostors are added to LOD Groupz as with any other regular mesh.

    Looking forward to follow up questions.

    Thanks!
     
    SilverStorm likes this.
  4. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    So I'm a bit confused still because here in your video at 40sec you show a field of trees that all using the imposter system so how did you do that? Did you create 1 imposter for the first tree prefab then just duplicate tree everywhere and that's that?
     
  5. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    No problem, I'll elaborate.

    Regardless of using Amplify Impostors, you should always create Prefabs for your objects, this is an absolute requirement for an efficient Unity project; changes made to a Prefab will propagate to all instances in your scene. This can be pretty much anything but, in our case, it could be the specific actions to add an Impostor to the Prefab LOD Group, or even to replace the actual model in the Prefab and use a singe impostor asset.

    In the Tree scene you're referring to, we use a simple script to scatter those trees which are made of a single prefab with a LOD Group with 2 levels, the model and the impostor. It's important to note that we're using a script but they could have been very well distributed manually or by using the Terrain tools.

    Does this clear things out?

    A side note, I would like to mention again that you should always consider if the original asset needs an impostors; e.g. a 360 impostor of a blade of grass Quad will be more costly than the original.

    Do you happen to already have scenes with distributed objects without prefabs?
     
    SilverStorm likes this.
  6. willygaelhypnovr

    willygaelhypnovr

    Joined:
    Oct 25, 2018
    Posts:
    5
    Hello!

    Thanks for your reply.

    The first shot is the default config after adding the AmplifyImpostor component on the object. All I did was to save the AmplifyimpostorAsset to a custom folder in the project.

    I changed the shader on the mesh to a Standard URP Lit, and was able to bake. It looks like the speedtree shaders aren't compatible with the baking process.

    I am using SpeedTree 7 shader for grass.

    By the way, is it possible to bake a whole terrain? That could be very useful for distant parts of large terrains splitted into smaller pieces.
     
    Last edited: Nov 26, 2020
  7. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Apologies for the inconvenience, I can confirm that there is a problem with SpeedTree bakes in URP, this is going to be examined by a developer asap; thanks for bringing it up.

    I'm afraid it's not possible to bake terrains, a mesh using a Mesh Renderer component is required. You could use Mesh Terrains but we don't recommend it; given that Impostors are not a 1-1 representation of the original mesh, you might see holes/seams between terrain tiles.
     
  8. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
  9. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there,

    Unfortunately that won't work as AI requires a shader with its Deferred path exposed, those Toon shaders are Forward Rendering only.
     
  10. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Huh, now I don't understand. It says clearly in the feature list that it is for both forward and deffered. Is that wrong?
     
  11. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    I would like to have the imposters have different lighting at different times of day in my game, would I have to bake many copies in different lighting conditions and swap them in order to achieve this? I saw on the roadmap that runtime baking is coming and that would make it massively easier but is there an ETA for that or a workaround for now?
     
  12. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Apologies for any confusion, it's capable of Deferred and Forward Rendering as mentioned, baking requires a Deferred shader.
     
  13. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    You can have different light conditions, provided that you're lighting the Impostors with either dynamic lights or baked lightprobe data.
     
  14. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Ok, so if I don't bake I should be ok?

    And what is baking? I checked the wiki, but I don't get what it actually accomplishes in practice. What's the difference between a baked and unbaked mesh?
     
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    You have to bake, baking is the act of creating the Impostor.

    In simplified terms, it bakes/creates a sort of billboard representation of your asset which results in a custom impostor asset made of a Texture set and a Custom Runtime shader.
     
  16. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Yea, that's what I thought and why this is confusing.

    If you have to bake and you can only bake if you don't use forward, how can you say it supports forward? What am I missing here?
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Well, it supports both on the rendering side, it's the bake that's exclusive to Deferred. This means that you can bake a deferred shader and then use a custom Forward-only shader, with Forward-specific features, if you so choose to.

    There's a separation between Bake and Runtime(the actual shader that will render the impostor.)

    Hope this clears it up.
     
  18. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Ok, now I get it. I use forward, not because I have to but because it's recommended by my assets, mostly my post effects. I can't remember if I actually had any issues putting it to deferred.

    So lets say I put it to deferred, and everything looks ok, I bake, then switch back to forward. Then it should also look ok, even while lit by lights and with post effects?
    Also, you don't actually bake any light or other effects right?
     
  19. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Cool!

    Well that depends, what do you mean by putting it in Deferred? There's a couple of things you can only do in Forward, hence my question.

    But yes, Impostors should work fine with post-effect; lighting is not baked in impostors, they do support dynamic lighting or Lightprobe data.
     
  20. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Well, I'm only aware of the settings on the camera itself. That's what I mean by putting it to deferred and back. There's also the graphics option for the final build, they would be set to forward. But that shouldn't matter right as long as it's baked when the camera is set to deferred?
    Or are there any other ways to do forward/deferred that I'm missing?
     
  21. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Ah ok, I'm actually referring to the shader itself and not your camera mode.

    To give you a specific example; Custom Lighting Toon shaders are renderer in forward, they are set to Forward in the actual shader, baking something like this will not work regardless of changing the camera mode because the shader is forward only.
     
  22. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Ok, now I see.
    Let me give you a theoretical example: if I use a shader for these objects that's not forward only, like the default Unity one, and since these objects will never get close to the camera, I could bake these objects with this other shader and leave the toon shader for the closer objects?
    And would this method work if they are in the same LOD group? Toon shader for the closer meshes and an other shader for the imposter billboard?
     
  23. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Sure, that would work from a technical standpoint. The impostors can be put on any LOD Group just as with other assets.
     
  24. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Very good, thanks for the help. :)
     
    Amplify_Ricardo likes this.
  25. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Hi again, I have one more question. How does batching work for this? Does it use Unitys built in system or its own or do I need a GPU instancer? Does it work if the object is not static and moving?
     
  26. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hello there,

    It uses Instancing, not Batching. You don't need any additional tools, Unity provides the GPU Instancing technique. You just need to make sure that it's enabled on the Impostor material.
     
  27. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
  28. Semi_sus

    Semi_sus

    Joined:
    Dec 2, 2020
    Posts:
    3
    Anyone who plays a bit, be it PC games or RPGs, knows that a game cannot do without items. If we are at war, the most important items are weapons and ammo. If you are in the forest, your most important items are weapons such as a bow and your ammo or arrows. And even if you are not a gamer, your most important items are cash. The whole world revolves around items, so every time we have to check the level of our items. If we learn to remember to buy PoE items in the game, I am sure that we will not forget to buy PoE items in other areas of our existence. PoE items introduce a habit that, in my opinion, will allow us to facilitate various matters, not only in PoE
     
    Last edited: Feb 21, 2021
  29. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I'm afraid not, toon shaders are usually Forward rendering only which are not supported by the bake process.
     
  30. arie1994

    arie1994

    Joined:
    Jun 30, 2016
    Posts:
    86
    skinned mesh support?(here its made out of individual parts)
     
  31. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    I'm afraid not, only Mesh Renderers; that video is indeed made of multiple parts.
     
  32. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    I noticed when using the frame debugger that my impostors don't seem to instantiate as well as other objects do (like almost never), and if I set them to batching static they don't render at all. So if I change one of my LODs into an impostor I'll get more drawcalls. Is it supposed to be like this or am I missing something?
     
  33. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there, can you elaborate on how you're testing this?

    Amplify Impostors does not work with batching, only GPU Instancing which does allow you to dramatically cutdown on draw calls.

     
  34. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    Thank you for the quick answer!

    When using the frame debugger I get this. The first one is the scene right at start without impostors. The second one is where I switched the last LOD on one of the rocks in the scene into an impostor (also at the start of the scene, so everything should be the same). So it adds 37 draw calls.

    upload_2020-12-4_15-44-23.png

    upload_2020-12-4_15-49-57.png

    When looking closer you can see that a few of them actually have been instanced, but there's only a few, and only just like two or three at a time. The rest of them makes a draw call per impostor.

    upload_2020-12-4_15-53-7.png

    My other rocks in the scene are batched together with SRP Batching. They can be like 20-30 rocks batched together.
    upload_2020-12-4_15-55-31.png

    Is it just that SRP Batching is more effective than CPU instancing? Or am I misinterpreting the frame debugger?
     

    Attached Files:

  35. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there, thanks for the details.

    I can confirm that from our initial tests we're not seeing similar results. Would it be possible to test an example scene on our side? We're available directly via support@amplify.pt.

    We'd appreciate additional details regarding Unity and SRP version used.

    Looking forward to your reply!
     
  36. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    Hey there, y'all.

    I'm using Unity 2019.2.18f1, without changing from the built-in RP, because a lot of assets I own haven't updated to support HDRP yet (what a freaking headache, it's been two years). But I need deferred rendering for all of my plants, water, weather, etc. so URP is useless. For some reason, when I install Impostors, and try to search for the component script to add to an object to create an Impostor, it can't find the script. Is this a common issue, with a simple workaround? I didn't see where anyone had asked about this in the forum, but I'm sorry if this question has been answered already.

    Basically, do I have to be using a render pipeline in order for this to work? I'm getting these errors:
    upload_2020-12-10_23-38-31.png

    Thanks.
     
    Last edited: Dec 11, 2020
  37. eron82

    eron82

    Joined:
    Mar 10, 2017
    Posts:
    83
    is it possible to create an impostor of an animated character?
     
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hello,

    There's definitely some sort of Unity issue there that's preventing Amplify Impostors, and possibly other scripts, from executing; hence why you don't see it. The console log hints at another asset that could be using an incorrect namespace.

    1. I would recommend opening Visual Studio and searching for "ExtendedFlycam", see which scripts come up.
    2. Do you happen to have 2 Amplify Impostors folders? (do a search)
    3. Can you replicate the issue on a new empty project using the same Unity version?

    As always, please be sure that you are using the latest AI version available.

    It is not, AI requires a Mesh Renderer component.
     
  39. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    Yeah, looks like Advanced Foliage Shaders by Lars Bertram has a script titled ExtendedFlycam.cs, whereas the same dev's Lux Water has LuxWater_ExtendedFlycam.cs. Is this a built-in Unity script that this overwrites? Are you also doing so, or just referencing it? Seems like lots of folks want their own version.
     
    Last edited: Dec 11, 2020
  40. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    I deleted the file from AFS temporarily until I find a permanent fix. But now I'm running into a whole host of errors in your AmplifyImpostorNode.cs, where it can't define a series of methods. upload_2020-12-11_13-48-23.png upload_2020-12-11_13-48-40.png

    All sorts of issues. I tried re-importing it 3 times. Can I somehow delete the files outside of the Unity Editor, so I can redownload the package? Or is something else a better fix?
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Perhaps you can install Amplify Imposters in a different project? Conflicting scripts is an issue you'll come across with many plugins and art assets.
     
  42. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    But this looks like the scripts for Impostors themselves don't establish variables or methods that they then later call on in the script. For instance, 'GenerateSamplingCall' is not one of the myriad things created in the list of other similars. So when it calls on that, it sends an error that GeneratorUtils has no definition for GenerateSamplingCall. It seems like a chunk is missing?? I'm not an expert in programming, but I meagerly code is 5+ languages. I can at least usually find my way around. But in this suite, there is no method created for the thing being called. It's not like there are two overwriting each other, at least from the error it throws. The suggested fixes in Visual Studio only include generating the correct method.
    upload_2020-12-12_13-51-19.png

    I mean, I'll try installing it in a separate project definitely. But I'll be no less confused, if it works in isolation.
     
  43. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    Damn it, that did work. Now I have to sit through figuring out which program is the problem. Wish me luck, y'all. I hope it's not something substantial like Enviro.

    [EDIT] It is a substantial conflict. Invector (an older version) is the culprit. Strangely, it didn't show up in any searches. I just took turns deleting major packages and it turns out that that asset package ins the problem. Big bummer. I don't need that package while I build environments, but I'll have to solve the problem eventually, when I turn my dev toward character control. Maybe your team can work with those devs and make sure your pieces work together? May be something as simple as them removing a script or rename something.
     
    Last edited: Dec 13, 2020
    hopeful likes this.
  44. Quittern

    Quittern

    Joined:
    Oct 9, 2018
    Posts:
    19
    I figured it out. It was the light probes in the scene that makes them not be instanced together. Not much to be done about that I think other than trying to optimize our use of light probes. Thanks anyway!
     
    Amplify_Ricardo likes this.
  45. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    It could just be similar in name, and that's a problem, hence why they must be in the correct namespace.


    I see, it's hard to pinpoint the cause exactly because Unity may be preventing quite a few plugins from running. That's why namespaces are useful, if every developer keeps to his own there wont be any conflicts.

    There could be some cases in which both developers use the same script, in this case you cannot have duplicates; I suspect this is the case with the ExtendedFlyCam which is taken from the http://wiki.unity3d.com; try removing them to see if that solves the problem. If the problem is not fixed, you should see new hints on the console to what could be happening.

    Hope it helps.
     
    hopeful likes this.
  46. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    Thanks for the great support earlier! I have another question, how good is ASI at making terrain chunk impostors. For context the chunks are the world streaming chunks. In Gaia it just turns faraway terrain into low poly mesh but wouldn’t it be more performant and look nicer with ASI?
    I haven’t tried it yet but when contacting Procedural Worlds they told me terrain chunk impostor generation was difficult, I was wondering if ASI has this capability and how well it works. Thanks again!
     
  47. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, I am trying to use this in HDRP 7.3.1 and Unity 2019.4.9f1. After importing the packages, including the HDRP package, I always met this error. What could this be about?
     

    Attached Files:

  48. zetingq

    zetingq

    Joined:
    Dec 8, 2016
    Posts:
    26
    I also encountered the same problem, my version is unity2020.1.14 URP
     
  49. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,389
    Hey there!

    Sadly, it's not something we can support at the moment. Additionally, it might actually show gaps between tiles so it's not a great solution for actual terrain chuncks.

    However, could be good for actual Meshes if used carefully and from afar.



    Hi!

    Check if you have any Symbols Under Project Settings > Player > Scripting Define Symbols; clearing Amplify Shader/Impostors stuff from here could help.

    Are you both on the latest AI version?
     
  50. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Yes, it works! It also works if I upgrade to the latest ASE, and thanks for the quick response:)
     
    Amplify_Ricardo likes this.