Search Unity

[BETA RELEASE] Amplify Impostors

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

  1. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    219
    It does have a mesh renderer component?
     
  2. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    57
    Unity: 2019.1.14
    HDRP: 5.7.2
    AI: 0.9.2
     
  3. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    57

    The first error is no longer an issue, but the second one remains. Even in a fresh project with above mentioned versions.

    EDIT: It works on HDRP: 5.16.1, however this is not a viable solution for me because a few other assets aren't compatible with this version.
     
    Last edited: Sep 13, 2019
  4. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    286
    Hi all here's a new version that should fix some issues you are having in some SRP versions.
    Unfortunately the way HDRP have been changed so much do prove difficult to support shader wise. Right now there isn't a good solution to prevent errors from showing at least at install time. That said once you focus an impostor and the inspector is visible it should detect what version you are using and change things accordingly. We'll try to find a better solution that doesn't spam you with errors. Sorry for the inconvenience.

    Amplify Impostors 0.9.6 rev001 & rev002- Asset Store - Amplify Products

    Fixes
    • Fixed issue with standard shaders not compiling "_ShadowCoord" correctly in certain conditions in Unity 2017
    • Fixed issue detecting and using the correct version for SRP v5.7.2 and v6.9.0 that was causing issues with baking and rendering
     
    ftejada likes this.
  5. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Hi, I am trying to replace a town made of 100 small buildings and I want to bake the whole town to avoid too many draw calls. But a portion is disappearing when camera moves toward the edges. Octahedron 4K images below:
    EDIT: When I increase the position.y by 2 units they appear. its like part of them renders behind terrain. How can i stop this weird rotation which causes them to go below terrain?



     
    Last edited: Sep 18, 2019
  6. unikum

    unikum

    Joined:
    Oct 14, 2009
    Posts:
    50
    Is there a rough estimate on runtime generation? I have a bunch of static objects that I would like to make a merged impostor of if they are enabled (if things are enabled/visible is up to the player). Is this something a runtime impostor generator could help out with?
     
  7. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Hard to say, it could be clipping but we can't know for sure. How many frames did you bake? I would recommend increasing them, or even changing the impostor type to HemiOctahedron(ideal for top view games).

    Impostors can help but, unfortunately, we currently don't have an exact estimate for real time impostors. We've been quite overloaded due to being shorthanded but we hope to speed up things soon.

    Thank you for understanding.
     
  8. SirSkylake

    SirSkylake

    Joined:
    Oct 19, 2016
    Posts:
    3
    Hi, i have bought Amplify Impostors but dont't work, here some screen.

    I have created a normal 3d project with Unity 2019.1.11f1 import Anplify Impostors drag tree prefab on scene and press Bake Impostor but that generates black textures.



    Immagine1.png Immagine2.png
     
  9. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    I've already tried Hemi and I've tried 16 and 32 axis frames on 4K resolution. The town does not disappear it just renders below terrain as if it has been rotated when it is on the edge of the screen. If I deactivate the terrain the town is still there. I tried to replicate this with simple cubes and got the same problem. It looks to me like a shader error on this viewing direction.
    edit: I tried clipping values and other material settings and problem persists.

    https://ibb.co/Wy8SZGW
    https://ibb.co/x8RpW57
     
    Last edited: Oct 1, 2019
  10. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    335
  11. desertGhost_

    desertGhost_

    Joined:
    Apr 12, 2018
    Posts:
    99
    Hi,

    Does this asset work with the Unity ECS Hybrid Renderer?

    Thanks.
     
    ftejada likes this.
  12. HonKasumi

    HonKasumi

    Joined:
    Apr 25, 2018
    Posts:
    38
    Hii, does this also work for mobile, i i mean does it have have any issues in mobile, because i want to use it in multiplayer that's why im asking
     
  13. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    Seems like a precision issue in the shader code. Perhaps a double rather than a float is necessary.

    I know this is old, but seems like the author isn't around, and I was wondering if this error was shader precision related. I got the same perspective errors once before when I first tried amplify imposters way back.

    Can anyone confirm?
     
  14. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    Also, perhaps the generated texture of the town isn't taking a good enough average of each individual house transform or averaging these correctly. This would definitely cause the singular texture rotation origin to be way off and wonky like you're seeing there.

    Really curious about the solution to this.
     
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Greetings everyone, apologies for the delay, hopefully we can assist you quickly!

    I'm afraid the shader used in not compatible, try a Speedtree or Standard Shader for baking, that should provide immediate results. Alternatively, we do offer custom shader support but I don't think it's an adequate solution for your problem as it would be simpler, and faster, to just change the shader.

    I think we'll need a sample to debug this issue, can you send us that test case?

    Works with Lightweight, it will be updated shortly to work with RP as it's known now.


    Should work just as with any other mesh, be sure to let us know if that's not the case.(AI does not use any custom scripts, it's all done via shader)

    It works on mobile, it's a great way to improve performance. Be sure to let us know if you run into any specific mobile issues, we would be happy to tackle them.


    Hard to say, it's probably best to test a sample using the same exact conditions and project configuration before going into detail; in any case, we will debug it on our side.

    Thanks!
     
    Last edited: Oct 23, 2019
    awesomedata likes this.
  16. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    I'd like to know how this pans out.
    My use-case for imposters is much bigger.

    I am designing a project workflow right now and am wondering if/how Amplify Imposters is going to hold up to the task of being able to snapshot an entire terrain or (actual) meshes (seamlessly) with trees/grass on it so it can be displayed in the distance, something akin to how Zelda Botw looks with its distant terrain.
    I don't plan on including any dynamic entities, but animated imposters (which might let me include things like waterfalls) would be nice one day.
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    We'll be sure to post any details here when we have them.

    Amplify Impostors can bake large numbers of meshes into a single impostor but this will ultimately depend on how you have your scene setup; meaning, you should definitely test for any possible corner cases.

    I don't recommend using it for the actual base terrain mesh, Unity terrains are not supported as well.
     
  18. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    893
    What is the recommended setup for changing streaming tiled terrains into seamless imposters? -- For example, what is the upper mesh size limit that could be changed into an imposter?
     
  19. ZackTwisted

    ZackTwisted

    Joined:
    Sep 29, 2017
    Posts:
    4
    Hello everyone,

    I'm facing a small problem creating my own Amplify Impostor Runtime Standard shader. I follow all the steps found in here: http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Impostors/Custom_Baking. But I'm not able to see any visuals. Only once the clip value is set to 0, I can see a black quad facing the camera.

    This is the shader's inspector:
    upload_2019-10-31_11-35-16.png

    This is the impostor shader:
    upload_2019-10-31_11-35-55.png

    And the visual when clip is set to 0 is this one:
    upload_2019-10-31_11-36-29.png

    One the clip is set to 1, the quad just disappear.

    Am I missing something that should be done in order to see the impostor working?
    How could I create a custom amplify impostor shader to create some extra effects on it?

    Thanks!
     
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Hey there, we don't really support Unity terrains. As for regular meshes, it's whatever your Unity version can handle per-model; there's no specific limit.

    Hello,

    It should work if you followed the instructions, which Unity version are you currently using? Be sure that you're also using the latest AI build and that your preset matches the necessary properties.

    We would be happy to examine a sample on our side.

    Apologies for the inconvenience.
     
  21. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Hi to reproduce you can just place cubes the error is still there I will create a simple test case later and edit my post.

    Btw to create an impostor of your terrain you could bake the terrain to mesh with free utility scripts, break it to chunks with a 3d modeling tool and create the impostors.
     
  22. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    We could use some details such as distance and impostors setup; is it one impostor per-group or cube?

    That's a cool tip, as long as you're careful with possible seams, it should work well!
     
    Last edited: Oct 31, 2019
  23. ZackTwisted

    ZackTwisted

    Joined:
    Sep 29, 2017
    Posts:
    4
    The impostor system works perfectly when I set both "bake shader" and "run-time shader" to null. As I have read in the manual, they are set as default if nulls are found.
    What I'm trying to achieve is to set only the run-time shader (So I can do some stuff with the impostor visuals), and leave the bake shader to null, so it gets the information from the G-Buffers.

    I'm using latest build AI. Unity version is 2018 LTS last version (2018.4.12f1).

    Is there something I'm misunderstanding or something I'm doing wrong?

    Thanks!
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    It does seem to be working from our tests so I'm not entirely sure what could be causing the issue on your side. Can you share a screenshot of your Bake Preset and Impostor parameters?



    Thanks!
     
    Last edited: Oct 31, 2019
  25. ZackTwisted

    ZackTwisted

    Joined:
    Sep 29, 2017
    Posts:
    4
    Here is the Bake Preset:
    upload_2019-10-31_16-54-30.png

    And here is the Impostor parameters:
    upload_2019-10-31_16-55-18.png

    If I can provide more information to help you, just request it.

    Thanks in advance!
     
  26. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Seems alright, are you also using the latest ASE version? I'm using the same setup and Unity version and it works as expected. Do you see any warnings in your console?

    I think it would be best to test a sample; we would really appreciate it if you could send us the original asset and faulty impostors(along with the bake preset and shader) just so that we can replicate the same conditions on our side.

    We're available via PM or support@amplify.pt, apologies for the inconvenience.
     
  27. cashtrevor

    cashtrevor

    Joined:
    Oct 14, 2019
    Posts:
    2
    Hello, Is support for Unity 2019.2.9f1 being worked on? I still get material errors when baking impostors.
     
  28. Amplify_Paulo

    Amplify_Paulo

    Joined:
    Jul 13, 2017
    Posts:
    286
    Hey there, I went to check your example out. I think you hitting one of the limits of this technique. In order for the object to look 3D while being a billboard the depth is prebaked and then used in the shader to write the object depth similarly to the real object, however the billboard effect itself is camera dependent because it needs to always face the camera, and the parallax effect that is done to give the illusion of 3d is both depth and camera dependent. And since your set of cubes becomes a very flat compound of objects that are really close to the ground and thus very "depth needy" it magnifies the precision issues from both the depth map and the parallax effect. Setting the texture to no compression helps a bit with the artifacts but not with the depth, the majority of the depth issue comes from the parallax effect and billboard effect that isn't totally precise. This is actually one of the reasons it looks so weird upclose, because the parallax and billboard can't cope with the high depth difference.

    The only solution I could find involves editing the rendering shader to purposely pull the depth of the impostor towards the camera just enough to make it not go under the plane, but this is not a perfect solution since then you end up having depth issues where your impostor is on top of other objects when you don't want to. Impostors were never meant to be this precise and to substitute such large objects. The real solution would be to create individual impostors for each house. This would introduce more room for imprecision but it would also mean you wouldn't need such large maps, you could do very small resolutions for each house instead of one giant one for the entire city. This is actually how it's done in fornite, you pick a "repeatable" asset to impostor that you want to maintain detail and you replace each entry of that asset with the impostor using any LOD system of choice. It's all a balance between the number of polygons in the screen and the rendering of those.

    hope this helps

    It should already be working, are you perhaps referring to some SRP? There's still issues with newer HDRP versions that need fixing.
     
    Last edited by a moderator: Nov 4, 2019
    VictorKs likes this.
  29. VictorKs

    VictorKs

    Joined:
    Jun 2, 2013
    Posts:
    146
    Thanks for looking into it yeah maybe a hacky depth adjustment could fix it. Anyway I fixed it by adjusting the lod distances so overhead "problematic" views use 3D model and all the other towns are impostors and it works great. It's good to know about that limitation though for future projects. Thanks again for the support!
     
  30. cashtrevor

    cashtrevor

    Joined:
    Oct 14, 2019
    Posts:
    2
    Thanks for the reply, sorry I meant for the HDRP pipeline. And It seems to be mostly working now (I did not unpackage the extra HDRP package from within unity).

    Now I am running into another Issue (no compile errors are thrown):

    I am trying to create an imposter with the following geometry:


    After baking I get the following imposter:


    I also tried with LWRP and get the same results
     
    Last edited: Nov 9, 2019
  31. noobynobody

    noobynobody

    Joined:
    May 9, 2019
    Posts:
    76
    Hello, I'm making a mobile game and I'm wondering if I make everything an impostor, how bad that will look. Anyone have a video showing the player walking through a bunch of impostors (preferably a city scene)?
     
  32. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Thanks for the details but I can't open the image, seems to just be a thumbnail.

    Same result if you import the package mentioned in the Manual? (AmplifyImpostors\Plugins\EditorResources\RenderPipelinePackages))

    We would be happy to test a sample on our side.

    Hello!

    There are a couple of example on this thread but not a full city. It really depends on how you intend to use it as impostors are meant to be seen from a certain distance. Combining multi-mesh building models into a single impostor might be a great way to improve performance but you have to be careful not to render them too close, that's when it starts to "look bad".

    Thanks!
     
  33. noobynobody

    noobynobody

    Joined:
    May 9, 2019
    Posts:
    76
    It's for mobile, so I don't mind if it looks bad. I just want to know how bad. What I plan on doing is have 2 LODs, one that's the impostor, and the other the normal mesh, which appears when camera is within 5 meters.

    I haven't found any videos yet (tried searching "youtube").
     
  34. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Should be fine unless you're baking something very specific like giant construction cranes which could be problematic in some situations. (might seem strange due to their volume and thin features)

    I don't think there are many videos out there but if you show us a shot of your game from the player perspective, we should be able to provide more accurate feedback or even examples.
     
    noobynobody likes this.
  35. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
  36. ZackTwisted

    ZackTwisted

    Joined:
    Sep 29, 2017
    Posts:
    4
    Hi,

    I'm sorry for the delay, it's been some crunch days in the studio and I've couldn't answer in time. I've done a test project to send you, so you can check what I'm experiencing, and correct what it's being done wrong.
    Also I've found a bug in the amplify shader editor. I've done a shader that produce that bug and attached it to the project.

    How could I send you that sample project? If I can provide more information about these problems, I'll answer as soon as posible.

    EDIT: The problem with the amplify impostor has been solved, it was an error of concepts in the team more than an error itself (Still can't use a custom baked though). What is left from this post is the problem with amplify shaders that still persist.

    Thanks in advance!
     
    Last edited: Nov 12, 2019
  37. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    No problem, please make sure that you are using the latest ASE and AI directly from our website to avoid any version mismatch.

    I recommend using WeTransfer, you can send it to support@amplify.pt.

    Thanks!
     
  38. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    You might find this interesting(uses impostors): https://prehistorickingdom.com/blog/2019/04/30/devlog-16-april-2019/
     
    noobynobody likes this.
  39. lcpwrd

    lcpwrd

    Joined:
    Aug 23, 2018
    Posts:
    1
    Version0.9.6.002
    HDRP 5.13.0
    Unity 2019.1.14f1

    Shader error in 'Hidden/Baking HDRP': 'GetWorldToViewMatrix': function must return a value at /UnityProjects/AmplifyImpostors/Packages/com.unity.render-pipelines.core@5.13.0/ShaderLibrary/SpaceTransforms.hlsl(17) (on d3d11)

    Shader error in 'Hidden/Baking HDRP': undeclared identifier 'unity_MatrixV' at /UnityProjects/AmplifyImpostors/Packages/com.unity.render-pipelines.core@5.13.0/ShaderLibrary/SpaceTransforms.hlsl(17) (on d3d11)

    AmplifyImpostorsConfig.cginc:
    // Amplify Impostors
    // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
    #ifndef AMPLIFYIMPOSTORSCONFIG_INCLUDED
    #define AMPLIFYIMPOSTORSCONFIG_INCLUDED
    // turn the next define to 1 to activate neighbour frame clipping
    // use it only if your impostors show small artifacts at edges at some rotations
    #define AI_CLIP_NEIGHBOURS_FRAMES 0
    // don't touch the next define, it's automatically set by script
    #define AI_HDRP_VERSION 51300
    #define AI_LWRP_VERSION 60901
    #endif //AMPLIFYIMPOSTORSCONFIG_INCLUDED

    Works well with HDRP 5.7
     
  40. the_mr_matt

    the_mr_matt

    Joined:
    Jul 21, 2015
    Posts:
    61
    Hello!

    I'm having an issue using impostors in an LOD group with baked lighting. In the image below, the selected tree is an impostor in the shadow of the cliff. The second image is the same impostor positioned outside the shadow. All other trees have been baked using Bakery GPU Lightmapper including ambient occlusion. Notice how the impostor in shadow appears completely flat and darker than all other trees. Is there a way to make this look more natural? If I can't, I will not be able to use impostors in my game.

    (I wouldn't normally use impostors at this distance, it's just to clearly show the effect)




    Cheers!
    --Matthew
     
  41. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,399
    I guess the easy fix would be adding a dynamic light.
     
  42. the_mr_matt

    the_mr_matt

    Joined:
    Jul 21, 2015
    Posts:
    61
    I have a dynamic sun lamp. The baking was only indirect and AO.
     
  43. UnconventionalWarfare

    UnconventionalWarfare

    Joined:
    Jul 11, 2019
    Posts:
    13
    Hello,
    we're very interested in using this asset in our game. However, there's a potential problem.

    We're using the old Unity render pipeline in deferred mode, but we customized it quite heavily. We customized (among other things) the DeferredShading shader (the one that actually combines the various gbuffer textures into the final image). Values like occlusion, specular and roughness were repurposed and now do other things, because we're not doing PBR.

    I'm wondering whether or not this asset will play fine with that. I guess another way of phrasing that question is whether or not you can modify the shaders used for creating and later rendering the impostors so they don't write the usual PBR stuff into occlusion, roughness, etc.

    Thanks.
     
  44. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405

    Let me get back to you on that after we run a few tests, it seems that it's not importing things properly.


    I see that we already got back to you on Discord, let's try not to duplicate questions ;)

    As Paulo said on our Discord:
    "impostors don't support bake lighting without extra work, impostors are prebaked and intended to be used as repeated objects in the scene to save performance on highly detailed objects, baked objects have unique baked uvs with unique baked maps assigned to those UVs, which means, every tree is different as far as baking goes, this defeats the purpose of impostors, there is a way to bake this lighting information and use it in your impostors but then ALL of them will use it, which means that some of those trees would have the wrong light."

    You added: "Could I change how they look in shadow in general? All I want is a lighter color just when it's in shadow. From a distance that should look indistinguishable. It doesn't have to be customized per impostor"

    Reply: "You would need to create a custom runtime shader and override the bakedGI port check this page, it teachs how to create a bake shader and a runtime shader http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Impostors/Custom_Baking"


    Hard to tell, we would need to know more about your changes, or test it, but this is not something we currently account for. However, you can use custom bake and realtime shaders; I would recommend trying it out and see if it works for you, if not just reach out to us.
     
    Last edited: Nov 20, 2019
    UnconventionalWarfare likes this.
  45. UnconventionalWarfare

    UnconventionalWarfare

    Joined:
    Jul 11, 2019
    Posts:
    13
    Thanks for the response. I'll just try it out in the near future then. First I'll try to adapt the shaders myself and, if that fails, I'll reach out to you. It shouldn't be particularly difficult to get it up and running. Then again, gamedev is full of surprises.
     
  46. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    No problem, hope it works! We're also available via Discord if you're interested.
     
  47. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,178
    Hi
    I'm looking into this asset to be able to fast render Unity trees. How does it work? Unity already does billboarding of the trees when far. Is there a way to integrate this so that the Unity Terrain uses this for billboarding or how does it work?
     
  48. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Hello!

    You'd have to manually create the LOD Group for your trees but you can place those prefabs on your terrain. AI works by creating simplified camera facing quads, or simple polygonal shapes, that replace complex geometry by rendering a fake 3D representation of the original object. These impostors set themselves apart from regular billboards by providing a fake representation that can be seen from multiple angles that can be moved, rotated, scaled, receive and cast shadows, and intersect other objects or impostors.

    In any case, you can think of them as regular assets, you can place them on any level of your LOD Group.

    Let us know if you have any additional questions.
     
  49. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,178
    Do you have a sample of that created from Unity Trees? (no speed tree, they suck). And compared performance?
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    1,405
    Not at the moment, we do have a sample using regular model.
    Performance compared to billboards? Depending on the shader used, Impostors could be a bit more complex but this is impossible to know for sure without additional details.
     
    Last edited: Nov 27, 2019