Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Easy Decal - Decals everywhere

Discussion in 'Assets and Asset Store' started by Sycoforge, Oct 28, 2014.

  1. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Any word on the reported issue yet?
     
  2. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    We are currently investigating this issue. We have successfully reproduced it, but haven't pinpointed the cause.
     
  3. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Okay, we found the issue. It's caused by the sub-meshes of the tree. Until this issue got fixed in the framework, I recommend exporting the mesh with 3 child objects instead of 1 object with 3 materials.
     

    Attached Files:

  4. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Thank you for the reply
     
  5. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    I tested it out and it's not the same for me. I separated the tree into submeshes and copied the same decal 3 times. I put one on the terrain, one on the wall, and one on the submesh of the tree. As you can see only the one on the basic unity cube gets rendered. The one on the terrain is just a black blob, and the one on the tree is still invisible regardless.

    I put up 4 inspectors so you can clearly see that the tree has a separate mesh and that the decals are not working as they should. The first inspector is the tree, the second one is the black spot on the terrain, the third is the visible one on the unity box, and the fourth one is the one in front of the tree that isn't working.
     

    Attached Files:

  6. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    The black rendered decal is because you have forgotten to enable "Calculate Normals" and "Calculate Tangents". Decals with a shader that renders a normalmap need to have tangents.

    Where did you put the collider component? When having it on the parent game object (Tropical_Tree_Big_Kapok_002) you need to tell the decal projector to also include the children for mesh target lookup. Please enable "Recursive Lookup" und set the mode to "Down". You can find this setting in the "Constraints" tab.
     
  7. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Thank you for the help. Now it's working fine!
     
  8. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Glad to read! Have fun! :)
     
  9. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    I do have one more question. Do you plan on implementing the feature where you can have more materials on one mesh and have the decals still work? At the moment it's a deal breaker for us.
     
  10. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Yes. We have added it to our TODO list. But unfortunately, I cannot give you an ETA. What you can do though is to switch the projector to the Deferred or Plane (plane only for simple surfaces).
     
  11. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    We'll drop you an experimental version to your email once we have something to test. But these versions are not tested very well and are not recommended for production environments.
     
  12. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    @Murkawski Dropped a version supporting submeshes via PM. :)
     
  13. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Oh. Nice, I'll give it a go and report back
     
  14. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    623
    Hi im interested in this asset but is it dll ? Ive had bad luck in the past with dll asset being deprecated and no way to use them once unity updates to a newer version.
     
  15. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    You can access the source over our website.
     
    JBR-games likes this.
  16. curiouspers

    curiouspers

    Joined:
    Aug 7, 2014
    Posts:
    13
    Hello, I have a problem with box decals projected on a mesh within a parent with negative scale, I'm using baked lights, seems like decal has normals flipped. Using two sides material make decals almost black after baking light, but the flip normals switch hides the decal completely, how can i fix that?
     
  17. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Could you please post some screenshots illustrating the issue and the settings used on the decal?
     
  18. curiouspers

    curiouspers

    Joined:
    Aug 7, 2014
    Posts:
    13
    Here you go.
    All the settings are identical for both decals and walls.
    Only difference is that first wall with selected outline has z scale = -1 and you can see normals of decals as they are enabled on "Extras" tab, but you can only see the decal with digit 7 only from the back, as on second row.
    The third row is what I see if I enable Flip Normals - decals, normals and vertices completely disappear.
     

    Attached Files:

  19. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    Thanks for these illustrative screenshots. The box projector does indeed dislike negative scales. I added this to our to-further-investigate-list. For now, I would recommend going with the plane or ssd projector on mirrored objects.
     
  20. curiouspers

    curiouspers

    Joined:
    Aug 7, 2014
    Posts:
    13
    Thanks for looking into the problem. Negative scale geometry is a big deal in many cases, e.g. when you want to reuse the assets, say for symmetric levels, like this example.
    AlsoI can't use plane projection, cause the surfaces under projector are often very complex and plane projection generates not perfect mesh that generates AO when baking lights. And also I can't use ssd because that's a mobile project.
     
  21. Amaron77

    Amaron77

    Joined:
    Jun 16, 2018
    Posts:
    14
    Just grabbed this and imported to 2019.1. Got several warnings for mixed line endings. Obviously extremely simple for anyone to fix but just wanted to alert you.
     
  22. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    Thanks!
     
  23. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    You are right. I did add this one to our list. In an ideal world mirroring is supported on every level in an engine. But in Unity, you are better off not to mirror object as this will most likely break your lightmaps and lead to weird looking normals. We had to ban mirroring completely from our pipeline because of the reasons above. Instead of mirroring things, we already take this fact into account when planning the models and modules and make them symmetrical on the y-rotation axis. This way, we can only rely on rotational symmetry. I hope this was somehow useful. :)
     
  24. jeremydulong

    jeremydulong

    Joined:
    Nov 9, 2017
    Posts:
    11
    Is there a way to sort Box decals (maybe based on hierarchy?) so that the textures aren't z-fighting when they overlap? I'm using them for splatter effects but when there's 2 with different colors overlapping some weird clipping is occurring. Currently I'm using the EasyDecal/Legacy/Transparent Soft Unlit shader for all of them. I attached an example screenshot.
     

    Attached Files:

    Last edited: May 18, 2019
  25. Casss

    Casss

    Joined:
    Dec 13, 2016
    Posts:
    3
    Hi!
    How to start a Fade Out if a character entered the trigger?
    I tried but nothing works

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using ch.sycoforge.Decal;
    5. public class DecalRemuve : MonoBehaviour
    6. {
    7.     public EasyDecal[] DecalPrefab;
    8.  
    9.     bool hide;
    10.  
    11.  
    12.     void Update()
    13.     {
    14.         if (hide == true)
    15.         {
    16.             for (int i = 0; i < DecalPrefab.Length; i++)
    17.             {
    18.                 DecalPrefab[i].FadeOut = true;
    19.                 DecalPrefab[i].StartFade();
    20.                 DecalPrefab[i].FadeoutTime = 3;
    21.  
    22.             }
    23.         }
    24.     }
    25.     private void OnTriggerEnter(Collider other)
    26.     {
    27.         if (other)
    28.         {
    29.             hide = true;
    30.         }
    31.     }
    32. }
     
  26. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    235
    Maybe it helps if you add enabled = false; after your for loop.
     
  27. jeremydulong

    jeremydulong

    Joined:
    Nov 9, 2017
    Posts:
    11
    I believe I was able to solve the z-fighting issue by adding these lines to the subshader. I know nothing about shaders so this may have adverse repercussions.
    Code (CSharp):
    1.     ZTest LEqual
    2.     ZWrite Off
     
  28. Casss

    Casss

    Joined:
    Dec 13, 2016
    Posts:
    3
    Don't working:(
     
    Last edited: May 18, 2019
  29. sfaok

    sfaok

    Joined:
    Nov 27, 2012
    Posts:
    21
    I'm using Easy Decal for a Mobile VR project.

    My performance drops dramatically if I have [Decal Root] in the scene, even if there's no actual decal objects.

    Similarly instantiating a single decal into my scene (baked on awake) immediately causes the GPU to go into overdrive (clocks itself up about 50%). This coincides with [Decal Root] being automatically added.

    Any idea why this would happen?

    Edit: It seems Easy Decal adds a command buffer when active to the camera. This is a huge performance hit on mobile and Oculus heavily advises against it (same with render textures, blit etc). I don't suppose there is a way of setting up Easy Decal so it doesn't add this command buffer? Currently I'm using cam.RemoveAllCommandBuffers() to remove it (which works). Is there a more elegant way?
     
    Last edited: May 24, 2019
  30. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    737
    How does Easy Decal find the "Decal Root" scene singleton? It seems to find it by object name, rather than by type or the usual singleton methods, which I find a little annoying because I like to arrange and name things my way. Perhaps this is buried in one of the DLLs.
     
  31. Larzarus

    Larzarus

    Joined:
    Jun 4, 2016
    Posts:
    27
    Has anyone used Easy Decal deferred decals (SSD or just deferred) with MicroSplat terrain shader? I'm new to ED, so I may be missing something... but I can see deferred decals on regular meshes, and regular terrain, but not terrain when it's using MicroSplat shader(s). The ED is just not there.

    Plane, box, etc. work with MicroSplat, but I'd really like to have a normal-only shader for my terrain decals.
     
  32. MaeL0000

    MaeL0000

    Joined:
    Aug 8, 2015
    Posts:
    35
    Has anyone tried creating a cylindrical projector by implementing the IMeshProcessor interface as described here? I need to be able to project decals around objects so the planar projection provided by the plane and box projectors isn't enough.
     
  33. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    378
    Will this work with unity terrain that uses CTS shader?
     
  34. DaveLloyd

    DaveLloyd

    Joined:
    Nov 15, 2011
    Posts:
    14
    Hi! I've been playing with the box projector and hit a few issues:
    - Firstly it seems like meshes are cached somewhere? I have some procedural meshes and the decal reflects earlier geometry... Is there a call to flush it?
    - Secondly I've just seen comments here about decals not supporting meshes with multiple materials. Did that end up fixed and in the asset store version?
     
  35. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    Does anybody else have any issues with LateBake() not working? The documentation says the decal geometry will be baked on the next frame, but it isn't happening. Even feeding a specific number of frames doesn't work unless I set it to LateBake(5) or higher. But then surely it's recalculating the decal geometry five times when it shouldn't be necessary to do so?

    [Unity 2018.4.3f1]
     
  36. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    194
    I'm getting this error when a decal overlaps a dog model I have:

    "Not allowed to access uv4 on mesh 'Dog..Remap' (isReadable is false; Read/Write must be enabled in import settings)"

    Is it recommended to just make the model read/write as suggested in the eror?
     
  37. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    403
    So we've compared several decal systems in the asset store, and thought I'd mention what we found relative to this one.

    Easy Decal has a rather great setup for hand placing atlased decals. We use it in defered mode for performance and lighting.

    Unfortunately it is less well suited for large numbers of decals (like bullet sprays). The performance suffers badly.

    Decalicious, on the other hand, is well optimized for this scenario and just screams. We can bullet spray an environment to ridiculous levels and hardly impact the render time.

    Decalicious, however, has none of the satisfying tools for atlasing etc. that Easy Decal has.

    As the source code is not included for Easy Decal (Boo!), it's hard to isolate precisely why there is such a performance gap, but it would seem that one major component is a lack of instancing. Decalicious uses instancing, near as I can tell, there doesn't seem to be a way to do that in Easy Decal. Or maybe I missed something?

    If Easy Decal could get the same performance as Decalicious, it'd be the run away top pick. As it is, we can't use it in our use-case.
     
    Last edited: Aug 2, 2019
  38. Koehler_Games

    Koehler_Games

    Joined:
    Feb 17, 2019
    Posts:
    5
    Hey Will this script also make the bullet hole curve around a corner?
     
  39. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Willbkool_FPCS likes this.
  40. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Thanks for your extensive post. We have had a performance regression with the culling system which got disabled in the 2019.2 version. We have also added a new mode for deferred decals that do not change their transformation after instantiation. Please download the latest version from our website and let me know if the performance is better when disabling the new "Is Dynamic" option.
     
  41. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    This will change in the next patch. Also, you can download the source from our website. Just send us an email with your invoice number.
     
  42. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    The mesh decals will work for sure. The deferred ones should work too. You can request access to the evaluation version to be sure.
     
  43. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    78
    Yes. The box projector needs to access the geometry data to cut the decal.
     
  44. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    40
  45. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    I would recommend converting all the static decals to regular meshes (using the decal manager) before the final bake.
     
  46. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    Just updated to the latest version, and something is broken.

    The "Calculate Tangents" option has completely disappeared for Box Projection! This means I can no longer use normal maps as my decals get rendered completely black?? (Unless I switch to Plane Projection, then the Calculate Tangents option comes back).

    [Unity 2019.2.0]
     
  47. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    The "Calculate Tangents" option is only needed for the Plane projection-type because the tangents now get sampled from the original mesh to reduce CPU time. Normal maps should work as usual. Do you experience a rendering issue such as black decals?
     
  48. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    Yep, they're completely black.

    ed_black.png

    Same decal, without normal map:
    ed_ok.png

    Update - seems that it's only broken on terrains. Works fine on regular geometry.

    ed_reg.png
     
    Last edited: Aug 8, 2019
  49. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    682
    Does your model come with tangents data? If your mesh is not created procedurally, please check if the Tangent property is set to either Calculation or Import in the import settings of the model. We'll re-add the option, in the next patch with a warning message. Thanks for bringing this up.
     
  50. GfK

    GfK

    Joined:
    Aug 15, 2014
    Posts:
    107
    Just updated my previous post (which I don't know if you saw), to say that it's only rendering black on terrains - regular geometry seems fine.
     
unityunity