Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

[BETA RELEASE] Amplify Impostors

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

  1. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Hello,
    Please use something like GoogleDrive or WeTransfer; send a zip or Unity package with a scene, models, any prefabs, textures and materials. (support@amplify.pt)

    If you updated, you probably need re-import the AI HDRP shaders.
    Assets\AmplifyImpostors\Plugins\EditorResources\RenderPipelinePackages\ImpostorsHDRP.unitypackage

    You shouldn't need to make any manual corrections what so ever, which file was this?

    Thanks!
     
    Last edited: Jun 29, 2021
  2. Clamibot

    Clamibot

    Joined:
    Jun 28, 2021
    Posts:
    3
    Thanks, and also thanks for your earlier help.

    I fixed the issue on my end by modifying all the speedtree 7 shaders. I searched for all occurrences of _MainTex in SpeedTree7.shader, SpeedTreeCommonInput.hlsl, and SpeedTreeCommonPasses.hlsl, then replaced them with _BaseMap.

    This allowed the impostor to bake with its proper color data and ensured that speedtree objects had color.

    I'm guessing that this was supposed to happen out of the box without any modifications, but fortunately I'm a programmer, so it wasn't much of an inconvenience for me. I hope this helps other individuals who are experiencing a similar issue.
     
  3. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Thanks for the heads-up, and apologies for your troubles. We should be able to account for this on our end in a future update.
     
    Clamibot likes this.
  4. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    90
    Thanks. I will send you the current project after cleaning it up to reduce the file size.

    After I wrote previous comment, I deleted the amplify impostors folder and imported it again. That gave me the chance to bake with initial settings. But, if I change the axis frames slider, baking gets stuck and I have to force quit unity (it is not a crash this time but a force quit). Anyway, I am pretty sure the shaders are as the devs provided this time.

    Now, I just built my addressables to export a build, and the shader exception I mentioned before appeared after the operation. Strange that it only appears after building addressables or project. It says "undefined punctual filter algorithm" indicating OctahedronImpostorHDRP shader. When you select the shader on editor and double click the exception warning on inspector, HDShadowAlgorithms.hlsl opens in VS Code. Here, there are
    PUNCTUAL_FILTER_ALGORITHM definitions depend on shadow quality settings (I guess). This block starts at line 11. There are SHADOW_LOW, SHADOW_MEDIUM, SHADOW_HIGH cases but not any SHADOW_CUSTOM case. My project uses custom shadow quality. I just coppied the high quality case there and chaged the case definition to SHADOW_CUSTOM. Exception warning goes away. This is what I had done previously. However, the problem did not go away when baking with Axis Frames = 32.

    To be more accurate: Unity 2020.3.7f1, HDRP 10.4, latest version Apmlify Impostors, also using The Vegetation Studio, and the Amplify Impostors Add on for The Vegetation Studio. On an M1 mac.
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    27,826
    Amplify_Ricardo likes this.
  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292

    I fear that we might be mixing a few things here. Let me check if we still have access to our M1, we should be able to test the actual crash on our end.

    However, for build errors, we're going to need a testable project sample to help there.

    In any case, if you're using Vegetation Studio, and the add on, you might need to contact the developer along the way; we don't directly provide support for that, only errors on our end. I'm assuming you attempted to bake regular impostors without the add-on, is this not the case?

    Thanks!
     
  7. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    90
    Yes, I was trying with regular impostors... I am developing with 2 different approaches with 2 separate projects. One is on unity 2020.3.7 other is on 2021.1.7. So, I might be confusing with the info I give but actually I have to move fast with this project, so I am writing the case I encounter before filtering it, just incase there is any easy solution. Sorry for that.

    I just stabilized (they had other issues) both versions by baking with the initial settings. It just works like that in both TVE and ordinary impostors. Now, I will have sometime to first create a brand new project and see if this thing is happening there, and/or prepare one or both of my project files for your debugging. I'll let you know when I am ready.
     
  8. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Alright, thanks for elaborating.

    In order to best assist you, we need to know exactly what to test; when we run a ticket for further examination by the devs, we need to be really specific.

    1. Going back to the 32 axis crash, are we to assume this should be present on Unity 2021.1.7, HDRP 11, on Apple silicone when baking regular impostors? We've tested this on windows machines without any problems which would hint at something M1 specific. Have you tested this on a Windows machine?

    2. We need exact details, log, regarding the build errors. Along with the usual details for Unity version used and if this happens with regular impostors.

    3. "HDShadowAlgorithms.hls", can you give me the full console log there? How is our shader implicated? That is something we need to look at as you should not need to alter anything because of Amplify Impostors.

    In any case, a project sample would speed up things immensely if you're pressed for time; I fear that AI could be robbing you of time for something that it's caused by an issue on our end.
     
  9. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    325
    Is amplify imposters still considered in beta? :D
     
  10. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    I would say that in terms of stability, and supported features/renderer, that it's beyond beta. However, there have been some setbacks regarding realtime impostors generation which was one of of our targets for the first release.(we've not given up on this yet)

    Any specific topic on your mind?
     
    Gekigengar likes this.
  11. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    325
    your post cleared it up - thanks!
     
    Amplify_Ricardo likes this.
  12. hmcmillan

    hmcmillan

    Joined:
    Jan 13, 2021
    Posts:
    2
    Hey there,
    Just wondering if there is any update on the HDRP Diffusion / SSS baking issue? Tweaking the baked Diffusion & Features map manually in photoshop is helping me patch over the problem slightly, but would love to know where you're at with fixing it, and if it will be updated any time soon.
    Thanks for you time :)
     
    PutridEx likes this.
  13. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    90
    Hi. After deleting Amplify Impostors folder and importing the asset again it seems to be working fine on Windows on Unity 2021.1.7 HDRP 11. No code alteration made. It seems that the issue is M1 specific. I will clear the project to reduce its file size and send it to you for your testing. Is it fine to send a link to support e-mail address?

    With HDShadowAlgorithms.hlsl file: the exact exception is "undefined punctual shadow algorithm". I guess shaders are calling subsystems of HDRP and that file complains about PUNCTUAL_SHADOW_ALGORITM is not defined. The related code has if blocks that check shadow quality. SHADOW_ULTRA_LOW, SHADOW_LOW, SHADOW_HIGH are checked. But, AI shader has also SHADOW_VERY_HIGH defined inside. Since Unity's HDShadowAlgorithms.hlsl file does not have a check for SHADOW_VERY_HIGH (I think this might be forgotten on Unity side), it can not define PUNCTUAL_SHADOW_ALGORITM and throws an exception to the shader that makes the call to the subsystem. It is not on your side, it is on Unity's side. I added the SHADOW_VERY_HIGH check to HDShadowAlgorithms.hlsl file by using the same definition on SHADOW_HIGH block and it is gone.

    Thank you for your sensitive support. AI is one of the best assets I constantly use and I am very happy about it. After some more programming on a upcoming game mechanics, I will happily bake lots of models. I can now do it on Windows. M1 macs are new and they are expected to have problems. It might even be a Unity issue, not AI related.
     
  14. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    Hello,

    I am having the following error in an amplify shader. Can you advise? This is Unity 2020.3.13 and HDRP 10 latest version.

    Edited the post to avoid waste of time.

    upload_2021-7-2_15-57-5.png
     
    Last edited: Jul 2, 2021
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Hello there!

    Thanks for reaching out but for GPU Instancer specific support you will have to contact the original developer.
     
  16. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    @Amplify_Ricardo did you see the screen shot showing the error in your original shader? that's not GPUI. I think GPUI version is just inheriting your error. Do you know why it happens?
     
  17. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Ah ok that's ours, my mistake. Are you on the latest AI version?

    We'll give it a quick test on our end.
     
    sebas77 likes this.
  18. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292

    Interesting, please do let us know via email and we'll run a few tests on an M1.

    Thanks!
     
  19. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    this is actually the same bug I reported.
     
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    But are you on an M1?
     
  21. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    yes, I checked and the last update was done in January and we are on that one.
     
  22. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    no, but if you see the compiling errors, the second is the same message "undefined punctual shadow filter". It must be something more due to Unity/HDRP than the CPU/Environment
     
  23. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Yes, I've noticed, just need to confirm it for further testing.

    We'll get back to you soon.
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Testing it with the same Unity version on our end does not show the same error, seems to be baking as expected.

    -What's your currently listed HDRP version on the Package Manager window?
    -Would a small sample be possible? If you could replicate this on a new project it would really help.
    -Is the error triggered when baking or is it always present?

    Thanks!
     
  25. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    I'll try to prepare a demo for you so you can test it
     
  26. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    27
    Hello guys, one question, I have a project in HDRP initially, but we are going to work with HDRP and URP.

    It's possible that the impostor that I created with HDRP, switch to URP without the need to create the impostor again?

    I saw that the HDRP impostor has the shader "Hidden/Amplify Impostor/OctahedronImpostorHDRP" but I'm trying to switch to URP one, but I can't, any advice about this?
     

    Attached Files:

  27. Amplify_Ricardo

    Amplify_Ricardo

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

    We don't recommend this for regular workflow due to possible bake differences but you can swap the shader used by the URP one. They can be found under: Assets\AmplifyImpostors\Plugins\EditorResources\Shaders\Runtime. (hidden on the shader list, drag to material)

    If you don't see them there be sure to import the URP shaders first: Assets\AmplifyImpostors\Plugins\EditorResources\RenderPipelinePackages
     
  28. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    I am going to sent the project to repro the shader compilation bug via email
     
  29. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Thanks, we appreciate it!
     
  30. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,370
    Thanks you should have received the email, please keep me updated.
     
  31. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Hey there, I'm afraid we've not gotten any emails regarding this issue. Can you share your address via PM?
     
    sebas77 likes this.
  32. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292

    Hey there!

    Could you please update from our website and re-import the HDRP Shader Package?
    We just corrected a problem similar to yours, would be nice to confirm it.

    http://amplify.pt/download/

    Thanks!
     
  33. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    186
    I'm seeing some visual artifacts creating octahedron imposters for some objects. Specifically, it seems to come up when the original is long and thin. I do not see them with spherical imposters, but those don't look nearly as good if the viewing angle is changing. The artifacts are only visible at certain angles. It's almost like it's grabbing texture data from the next frame or wrapping around in the same frame. At other angles the imposter appears to be cut off along a line (as if the original was poking out of a cube and everything outside the cube was removed).

    Screenshot_7_12_21__16_25.jpg
    The settings were:
    Screenshot_7_12_21__16_29.jpg
    Padding and frames don't seem to impact it. Using the standard preset in place of the TVE one had the same issue, leading me to think it's something to do with the construction of the imposter, not the preset.
     
  34. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292

    That's expected with Octahedron impostors as they break down at close distances(a result of the technique used for smooth blending), the farther you get the less prominent those artifacts are; this is exacerbated by the thin geometry.

    The solution here is usually to use spherical impostors or ensure that the octahedron impostors are distant enough from the camera. The best way to increase individual view resolution is to reduce the number of Axis/Views baked.
     
  35. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    186
    Thanks! Good to know.
     
    Amplify_Ricardo likes this.
  36. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    90
    Hi...Thank you for helping... Sorry for late answer' I am out of city but the download helped. Thanks...
     
  37. DavidJMacias

    DavidJMacias

    Joined:
    Mar 23, 2014
    Posts:
    3
    Hello I have a quick question. I was able to get it working with URP but the albedo is only baking as black and white, it's not taking the color of my original. Any idea why that is? Thank you!
     
  38. DavidJMacias

    DavidJMacias

    Joined:
    Mar 23, 2014
    Posts:
    3
    Got it
    My mesh had a custom shader, I changed it to simple lit (URP) and then baked it no problem.
     
    Amplify_Ricardo likes this.
  39. MaNiC

    MaNiC

    Joined:
    Feb 18, 2013
    Posts:
    28
    Code (CSharp):
    1. RenderNodeQueue Page Allocator out of memory. Maximum allowed memory: 256.0MB
    I have a industrial model with 500+ material. It pops up this dialog and kill the unity process. How can I fix this?
     

    Attached Files:

  40. Blan3X1

    Blan3X1

    Joined:
    May 29, 2019
    Posts:
    24


    I want to buy this asset but in wanted know that does the models created by amplify imposter has big file size like i have 500 high poly models in my scene so after making imposters of it will the size of the model created by amplify imposter will be having how much size than the original model or less than half of the size of the original model.And is this asset good for mobile
     
  41. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    82
    You can configure the settings per each imposter. For file size, an example of my own models: the majority of my models use 1024 as the image size. You have to multiply this by how many textures you want (for example you can have anadditional images for specularity, normals, emission if you want) + the impostor models have most times only around 6 triangles which results in only a few bytes.
    So, it heavily depends on the texture-resolution you select, multiplied by the amount of textures (use for specularity, etc.).

    My final imposter models need around:
    - 300 bytes for the 6 triangles
    - for the main texture with resolution of 1024:
    1.3MB compressed on disk = 3.146 MB in memory
    - if you need emission, specularity and normals, it either the same as above for the main texture, but maybe you can reduce the resolution for these maps or you not always need emission maps or specularity.

    A single texture with resolution of 4096 on the other hand has 64MB (when expanded in memory, but you can reduce it on disk, again depending on your preferred compression settings).
     
    Last edited: Jul 30, 2021
  42. Blan3X1

    Blan3X1

    Joined:
    May 29, 2019
    Posts:
    24

    thanks for reply
    i had one more question so when u create a imposter a fake texture also will be created or it will use the original model's texture
     
  43. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    152
    The imposter creates its own texture.
     
  44. Blan3X1

    Blan3X1

    Joined:
    May 29, 2019
    Posts:
    24
    what would be the size of the texture created by imposter if the original size of the texture is 1MB.
     
  45. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    That's an interesting case, seems you're hitting some sort of Unity limit here. Can you share additional details on your model? Perhaps this can be broken down into individual bakes.


    The original Texture size is not a factor, only the Impostor bake parameters and its own textures.
     
  46. buc

    buc

    Joined:
    Apr 22, 2015
    Posts:
    82
    Your questions will be answered by how the technique works:
    First the impostor is something like a plane, imagine it as a photo-card. Therefore it can be just 2 triangles (polygons) even if the original object maybe has millions of triangles, but it can have some more, if you want to cut out the corners or have the photo-card following the shape of the object, for example following the shape of a tree.
    Then the created impostor texture is completly independent from the texture of the original object. The created texture stores a photo of the object from different angles. So you will see an array of the original object photographed at different angles. The higher the resolution of this texture is (you can chose different resolutions in the settings) the closer you can go to the impostor-object without seeing a difference to the original object, because all the little photos from the different angles have now more space on this texture and can be in higher detail depicted.
     
    Amplify_Ricardo likes this.
  47. BrightBit

    BrightBit

    Joined:
    Jan 22, 2013
    Posts:
    213
    Hi all,

    I've stumbled upon a bug. The lines of code that are supposed to calculate the normalized points on an octahedron are wrong:

    var uvX = (x / (framesPerAxis - 1)) * 2 - 1;
    var uvY = (y / (framesPerAxis - 1)) * 2 - 1;
    var vector = OctahedronToVector(uvX, uvY);


    Instead it should be something along the lines:

    var halfFrameSize = (1 / framesPerAxis) * 0.5;
    var uvX = x / framesPerAxis + halfFrameSize
    var uvY = y / framesPerAxis + halfFrameSize;
    var vector = OctahedronToVector(uvX, uvY);


    I also slightly changed the method OctahedronToVector to use the y axis to map the lower parts of the octahedron to the outer parts of the uv map. Here is a comparison:

    WrongOctahedronVectors.gif

    This error also effects the texture atlas usage:

    RedundantFrames.png

    The red areas contained redundant frames, so the texture atlas with 16 frames per axis is basically just storing 15 frames per axis.

    Unfortunately, I was not able to fix the error by myself yet as the implications of the bug are spread along multiple parts of the plugin. For example: The impostor shader also contains erroneous OctahedronToVector code lines. The example given above was from the GetCameraRotationMatrix method.
     
    Last edited: Aug 9, 2021
  48. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Greetings,

    Thank you for the detailed report, I will pass this on to our developer for further examination.

    If you're interested in discussing it directly, we're available via support@amplify.pt; it's the best way to share code in the actual asset.

    I will get back to you as soon as the developers can tackle your report.
     
  49. BrightBit

    BrightBit

    Joined:
    Jan 22, 2013
    Posts:
    213
    Thank you. I just want to add that the problem mentioned above only appears for even values of Axis Frames. Odd numbers work more or less as expected:

    oddFramesPerAxis.png
     
  50. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,292
    Thanks for the heads-up, I'll add this to your ticket; our devs should have some additional insight soon.
     
unityunity