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

Amplify Impostors - Next Generation Billboards

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

  1. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    What code should I change if I want to move AI into another folder? Otherwise the shaders would fail to open "AmplifyImpostors.cginc":D
     
  2. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    Hmm. The cracks are fine as it would only replace terrain at great distances. Also since I want super long draw distance I might try three LOD for the terrain which would go from terrain to Gaia’s generated mesh, then amplify impostors. Would that be possible? The amplify impostors would be generated from the mesh LOD because terrain is not supported.
     
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    I see, but we don't actually support Terrain Renderers, only Mesh Renderers.
     
  4. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    What do you mean, how are you moving this?
     
  5. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    I'm trying to move the whole AI folder into something like "Assets/ArtTools/" instead of "Assets/"
     
  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    You should be able to move it, what error exactly are you getting and when?
     
  7. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    "Shader error in 'Hidden/Amplify Impostors/Octahedron Impostor HDRP': failed to open source file:'AmplifyImpostors.cginc' at line 152 298 944 1080"
     
  8. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Never mind, I tried again today, and this error doesn't appear anymore:)
     
    Amplify_Ricardo likes this.
  9. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Is there some description about the converted DiffusionFeatures map, like what's the meaning of each channel? I'm now a little confused if I want to adjust the diffusion effect after conversion..
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Nothing else on your console? I would recommend removing and reimporting the latest AI package, along with the HDRP package under AmplifyImpostors\Plugins\EditorResources\RenderPipelinePackages.

    What Unity and HDRP version are you using?

    Great, do keep us posted.

    Well, there's actually a known issue with more recent HDRP versions; you'll likely see bake differences; the bake is done with the Custom Diffusion values taken into account.
     
  11. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello, I just got AI, and started playing with it. It works nicely with "solid" objects, but I seem to get weird results with trees
    Here is the first issue : I get weird pink/orange blocks on the tree (that's using a Nature Manufacture tree)

    The weird color seems to be linked to the specular and smoothness map, which is all pink, and if I remove it the color disappear : I still have blocks but they are just black.

    On the other hand, when using a custom shader (made with amplify shader editor I think, if that changes anything) on the same nature manufacture pack, I still get the blocks,but more importantly the color is off by quite a bit



    Are these things to be expected with foliage, are there any workarounds ?

    One last thing I was wondering, I don't know if you guys take requests, but is there any chance you would add a simple color multiplier for the whole impostor ? I seem to find that even "solid" baked impostor are slightly brighter than their base mesh, and I would love to be able to fine tune it...

    I'm using Unity 2019 LTS with HDRP by the way.

    Thank you !
     
  12. nukadelic

    nukadelic

    Joined:
    Aug 5, 2017
    Posts:
    73
    Does it currently support vr ? also I'm sure this have been asked before but i can't seem to find if the runtime imposter creation is have to be present in the scene or not , need something like your plugin that will make imposters for procedural generated chunks in mealtime , will it be possible using this plugin ?
     
  13. zetingq

    zetingq

    Joined:
    Dec 8, 2016
    Posts:
    26
    AmplifyImpostor uses the latest 0.9.7.005. After setting up according to your settings, there will still be the same problem, because unity will automatically add things in scripting define symbols
    upload_2020-12-21_9-23-30.png
    upload_2020-12-21_9-23-45.png
    Assets\AmplifyImpostors\Plugins\Editor\ShaderEditorNode\AmplifyImpostorNode.cs(740,22): error CS1061: 'TexturePropertyNode' does not contain a definition for 'ForceSamplingMacrosGen' and no accessible extension method 'ForceSamplingMacrosGen' accepting a first argument of type 'TexturePropertyNode' could be found (are you missing a using directive or an assembly reference?)

    I returned to 0.9.7.001, and then the problem disappeared
     
  14. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Following up on your Discord post in regards to the same issue, the "problem" here is the use a of a Custom Shader. AI has specific requirements, Custom Shaders are only supported via our own editor: this is an advanced topic, I would not recommend it if you're not familiar with shader development.


    VR(Desktop) is officially supported. However, realtime impostor generation is not, assets must be baked in the editor.

    Are you using the latest ASE?
     
  15. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    So if the terrain is converted to mesh it could be baked into an impostor right? Also I think this was answered earlier but if I have a mesh mountain with trees and rocks in it I could bake the whole thing into one impostor or must I make impostors or each object?
     
  16. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Hello Does Impostor work with URP?
    Cheers
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Just to be clear, Impostor baking requires a Mesh Renderer Component so, if your terrain is an actual mesh, you could possibly bake it.(referring to the actual terrain mesh here, not its props) Given that impostors are a lower resolution approximation of the original mesh, you might see gaps between terrain meshes.

    About the actual props(trees, rocks, etc), it might actually be better to create individual impostors, it depends on the use case. Do you have an example in mind?

    Hello, yes it does; along with built-in and HDRP.
     
  18. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    this is working just fine but the problem is with rendering .The impostors fully render on my 4gb mobile but the same impostor did not render on my low end device 2gb ram and give me the empty sene (Huawei y611). Anybody knows whats the problem?
     
  19. Amplify_Ricardo

    Amplify_Ricardo

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

    Hard to tell without additional details, could be Hardware or Unity specific; we'll need additional details in order to debug the isse.

    Please create a development build and run it on the Y611; check the console for possible hints. I recommend testing it with a new empty scene, using a simple impostor so we can isolate the problem.

    Additionally, we could use some other details:
    -Unity and ASE version
    -GLES version on both devices(confirm that Graphics API is not set to auto)

    Thanks!
     
  20. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    unity version is 2019.4.15f1 and grphics api was set to auto should i remove that?
     
  21. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hello, that depends, please run the test first.
    You can try forcing a specific OpenGL ES version and see if that works but run the test and check the console before changing it please.
     
    awais21 likes this.
  22. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    sure will do that in few minutes,anyway thanks for helping me out
     
  23. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    i run the development build but the problem remain same,console just give that message "Build completed with a result of 'Succeeded' in 61 seconds". For the development build i take one of your barrel model and made the imposter.My 2gb ram mobile(hawei y611) doesn't render the impostor and give me the empty scene look but my 4gb rm mobile was able to render the impostor.My 2gb ram mobile has a openGL E version is 2.0 while the 4gb ram has the openGl E version 3.2. I think the problem is concerned with the openGL version maybe or mybe with the shader.
     
  24. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    Yeah my use case was for a third person flight simulator. I was thinking individual impostors close but terrain and detail combination impostors further away because the view distance has to be fairly large. I have also considered camera stacking to make it more performant as well but these optimizations can be used in tandem.
     
  25. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    i did one more test i enforce the openGLES version 2 on my 4gb ram and the 4gb ram was also unable to render the impostor and when i switch back it to the openGLES3 IT was able to render the impostor.So this mean that the device which support openGLES version 2 not the OpenGLES version 3 will be unable to render those imposotrs
     
  26. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387

    Try OpenGL ES 3.0 on the y611, and OpenGL 2.0 on the 4gb device; it would be interesting to confirm the difference.

    In any case, 3.0, or higher, is recommended.
     
  27. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    i already did that and yep the problem is with the OpenGL 2.0 on OpenGL 2.0 it doesn't render but switching to the OpenGL 3.0 actually render the impostor,you are right OpenGL 3.0 is recommended below version will not be able to render the impostors.
     
  28. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Yeah, not sure if the terrain itself would be a good candidate but it's something to play with. We don't really have specific rules for what can be done or not, definitely a great choice for everything else if you're going to see it from above. Trees, rocks, etc, the instancing gains would be fantastic.


    You can target 3.0, I would honestly recommend it, 2.0 usage is ~11%.
     
  29. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    thnx for the help yep i will target 3.0 now
     
  30. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    Well is there any way to increase impostor Tris count to some extent to make it look more good,its still looked good enough but just curious to know,the impostor which i bake reach maximum 14 Tris,is there any option where we can set the tris.
     
  31. skiwee

    skiwee

    Joined:
    May 30, 2020
    Posts:
    32
    Yeah thanks for the help, I'll try various strategies. I suppose at very far distances, even further than mesh impostors I can use amplify impostors for the terrain, kind of like how in smaller game worlds 2d vistas are used to make it look like there are mountains and stuff around the main game world.
     
  32. zetingq

    zetingq

    Joined:
    Dec 8, 2016
    Posts:
    26
    Yes, AmplifyShaderEditor 1.8.4 version, do I need to upgrade to the latest version of this plugin
     
  33. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Tri count has no influence on the actual Impostor quality, the idea behind a custom mesh is to reduce overdraw. What exactly do you have in mind?

    Hope it works!

    You need to use both AI and ASE latest versions. However, perhaps I was not clear, you can't simply use an ASE shader, there are specific requirements.

    Amplify Impostors Custom Shaders
     
  34. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Hello. I'm using 2017.1.03f and I get 33 Error messages all on AmplifyImpostorNode.cs
    The funny thing is Amplify Impostors works without errors on other projects made with 2017.1.03f but even copying the folder from them to this project doesn't work. What could be the problem?
    upload_2021-1-4_19-5-45.png

    Also the impostors can't seem to use reflection probes. How can I enable probes for them?
     
    Last edited: Jan 5, 2021
  35. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hey there, is Amplify Shader Editor in the project?

    Should use probes by default, do you have a specific case in mind?
     
  36. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Yep. I import the latest updated AmplifyImposors to the assets directory of 2017.1.03f and it gives those errors.
    I don't have any specific case for the probes. I used the spherical, octahedron and semi octahedrons with forward and deferred rendering paths and none of them seem to read the probes. I even boosted the reflection probe intensity to like 1000 where everything else lights up but not the impostors.
     
  37. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Do you mean that you imported the latest Amplify Shader Editor?

    Check if you have any Amplify related Symbols Under Project Settings > Player > Scripting Define Symbols; clearing this could help. If not I would recommend removing ASE and AI, and re-importing only AI by immediately checking the console log for errors or warnings.

    I meant, do you have a specific case we can test? Probes should work out of the box.
     
  38. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I don't have ASE installed in the problematic project but the projects that have ASE, AI works fine. Though I just realized that ASE also doesn't work in this project and causes errors even though it doesn't do it in the other projects. The only Amplify product this project has is Amplify Occlusion but if I delete that I can lose the settings of AO in the scenes so I don't want to risk that. I couldn't find any Amplify related smybols under that directory.

    Edit; I figured out the reflection probe issue. If the speculars channel is empty it doesn't read the reflection probes.
     
    Last edited: Jan 7, 2021
  39. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387

    Ok let's try to clear things up bit, how many projects are you using here? What are the versions used so we can try to replicate it. I need to know exactly where and what errors appear.

    As for the probes, it's hard to tell what could be happening if you have a bunch of errors.
     
  40. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Probes work ok now. For now I can't spare the time to identify what's wrong. I decided to copy the assets from the non-working project to the working project and create the impostors there and move the impostors back into the non-working project so I can focus on my tasks.
     
  41. worldschild

    worldschild

    Joined:
    May 29, 2017
    Posts:
    5
    Hello, dear developer.
    Are you going to add unlit shader for URP package?
    It would be nice to have an option to use Unlit shader for some Imposters.
    Is it a big deal to add it?
     
  42. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    i have two questions to ask
    1: i have some same props(meshes) in the scene which are placed in different places in the scene.I combine all these meshes with the help of "Mesh Baker" one of the unity asset.How i can create the imposter of these combined mesh, i tried the simple way of creating the impostor like we do for one single mesh but the combined mesh impostors doesn't give the result it form the very weird shape.Is there any way to create the impostor for the combined mesh.
    2:When using the baked light impostor is a little bit dark than the original mesh,any workaround to solve this
    3: Below are the pics that how impostor react to baked light than the original mesh and its quite noticeable.
    01: impostor
    02:Real Mesh
     

    Attached Files:

    • 01.JPG
      01.JPG
      File size:
      14.9 KB
      Views:
      323
    • 02.JPG
      02.JPG
      File size:
      13.3 KB
      Views:
      320
    Last edited: Jan 10, 2021
  43. Amplify_Ricardo

    Amplify_Ricardo

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

    Does involve some work. In any case, now that SRP development is stabilizing, it's definitely something to keep in mind.

    Well the impostor does not use baked lighting, is the "real mesh" shot using baked lighting on that prop?
     
  44. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    sorry i cant understand what you mean by real mesh shot using baked lightning
     
  45. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Hey, one of your images didn't load, I'm having a hard time understanding what you're asking.


    1: i have some same props(meshes) in the scene which are placed in different places in the scene.I combine all these meshes with the help of "Mesh Baker" one of the unity asset.How i can create the imposter of these combined mesh, i tried the simple way of creating the impostor like we do for one single mesh but the combined mesh impostors doesn't give the result it form the very weird shape.Is there any way to create the impostor for the combined mesh.

    Please show was what you mean. Assuming that a regular mesh is created, and a compatible shader is used, it should be possible. If you're generating this combined mesh at runtime it's not going to work.

    2:When using the baked light impostor is a little bit dark than the original mesh,any workaround to solve this
    3: Below are the pics that how impostor react to baked light than the original mesh and its quite noticeable.



    Impostors do not use baked lightmaps(only lightprobes), I was asking if your screenshot 02 is using baked lighting on those boxes, that's not going to be baked. You should use light probes for smaller stuff whenever possible.
     
  46. awais21

    awais21

    Joined:
    Jan 9, 2018
    Posts:
    31
    Sorry from my side that you cant understand my question,i asked that there are 20 of barrels in my scene placed at different position, i simply combine them to form a single mesh to reduce the batches,i was asking that its possible to create the impostors of the combined meshes(Barrels). After combining they single mesh use the standard default shader thanks
     
  47. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,387
    Please examine my previous reply, elaborate, and feel free to ask any follow up quesitons.
     
  48. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hi, the unity importer comes with 16k textures (in 2020.2), how can i "unlock" that resolution for the baker?

    Edit: found it and added 16384 in the AmplifyImpostorInspector.
     
    Last edited: Jan 12, 2021
    hopeful likes this.
  49. Amplify_Ricardo

    Amplify_Ricardo

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

    Interesting, we will have to check it out!

    We don't have any details on official support for 16k baking, I will consult with the team.
     
  50. superkratos

    superkratos

    Joined:
    Sep 4, 2017
    Posts:
    112
    Hi, I have some trouble dealing with auto-generated diffusion texture for HDRP trees..
     

    Attached Files: