Search Unity

Easy Decal - Decals everywhere

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

  1. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Don't mark them as static if you need to move them. When they are moved, then you need to re-bake the decal with LateBake() - maybe write a script that checks the position every frame and calls LateBake() if it has changed?
     
  2. BouncedPhysical

    BouncedPhysical

    Joined:
    Jul 16, 2016
    Posts:
    58
    Hi nu-Asset.

    Can i ask if it would have a good and really usefully use in a Graffiti Maker game where the player has a Spry-Can and must paint on walls? Something like the GTA-SA graffiti but more more deeper,

    Thank you very much!
     
  3. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    I'm not setting them as static, I bake them once they are spawned, what is static is my geometry.
     
  4. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Have they got colliders? Have you setup a StaticMeshProxy?
     
  5. KristoferBoman

    KristoferBoman

    Joined:
    Feb 16, 2016
    Posts:
    61
    Hi,
    I have problems with batching decals. In attachment you can see that batching is broken because of "different light probes", but from script I have turned off reflectionProbeUsage and lightProbeUsage from DecalRenderer propery.

    Can you help me with this problem and comfirm that batching is working?
    decal.png
     
  6. DouglasLee

    DouglasLee

    Joined:
    Dec 25, 2013
    Posts:
    3
    I just purchased Easy Decal. After I import the asset and open easy_decal_doc.pdf, I found the verion in the document is 1.6.4. But the latest version is 1.6.8. How could I confirm I have the latest version (1.6.8)?
     
  7. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Open up the location of your ch.sycoforge.Decal.dll file and look at the properties. On Windows (not sure about OSX, sorry :( ). Then go to the details tab - should show up under product/file version.
     
    DouglasLee likes this.
  8. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    Yes, they have colliders that's why I included the videos showing the problem.

    Is whats a static mesh proxy?
     
  9. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    It references all the static colliderless objects. However, since they have colliders this won't fix the issue :(
     
  10. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    Just place the decal onto the object you want to decorate in the editor and then either bake it or convert it to a mesh.
     
  11. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    This is possible of course. Depending on the use case you choose between deferred and mesh decals.
     
  12. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    I'm very sorry for the late reply. For some reasons, we dont receive any notification for the main thread. Your private message notified me.
    The lookup searches for geometry data started on the level of the first hit collider. But in your case, the location of the combined mesh within the hierarchy changes (probably to the scene root) and the projector can not find them anymore.

    I'll double check the deferred issue.
     
  13. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    When nothing significant has been changed that immediately affects the user interaction or UI the docs get submitted with no changes. This just means that the last updates were affecting just the core framework. :)
     
  14. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    This should only be the case when working with deferred decals as they have disabled the auto batching functionality of Unity. (The auto batch will corrupt them).
     
  15. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    I'm not moving anything, what I'm supposed to do the prevent what you just told me?
     
  16. Blomidev

    Blomidev

    Joined:
    Dec 16, 2015
    Posts:
    11
    Does this asset have a built in way to place decals onto a mesh collider?
    Basically, I'd like to place these decals onto gameobjects which have a mesh collider, and no mesh renderer. Is that possible?
     
  17. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    This is currently possible when using the plane projection mode. We have this feature on our roadmap (Alternative mesh sources). We can provide you with an evaluation version if you need to test the plugin in your ecosystem.
     
  18. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello doeas your asset work with tesselation, or parallax ? I would to use it with color map ultra shader 3.0 or cts terrain shader, Is that possible ?
     
  19. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    When using the deferred projection mode it should work. When working with mesh decals the tessellated geometry is not accessible as this happens on graphics device level.
     
  20. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Is there a possibility that you will check it on any paralax shader? I'm using forward rendring in my cameras.
     
  21. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Actually, you can use parallax shaders with the mesh decals (basically, you can use every custom shader), but the generated decal geometry does not take tessellated geometry (of the decal receiver -> per example terrain) into account because the (e.g. DX11) tesselation happens directly on the GPU.

    I hope that was not formulated too complicated. :)
     
  22. Blomidev

    Blomidev

    Joined:
    Dec 16, 2015
    Posts:
    11
    I'm buying the asset on sale currently. The plane projection should work for me, because my meshes are quite simple, and it doesn't matter if it doesn't match the geometry exactly because the geometry isn't displayed. I will reply again if I can't get it to work properly in my environment.
     
  23. smonz3

    smonz3

    Joined:
    Jan 9, 2017
    Posts:
    18
    I figure I must be doing something wrong with runtime decals.. trying to do blood splatter and it works great, but the GC is absolutely rediculous! Capture.JPG
    The only way I could seem to get run time decals to spawn and not distort was to use the following settings:
    Capture.JPG
    Spawning it using a simple raycast then this function :
    Code (CSharp):
    1. EasyDecal.ProjectAt(decalPrefab[num].gameObject, EasyDecal.DecalRoot.gameObject, hit.point, hit.normal, rot, new Vector3(scale, scale, scale));        
    Any help would be appreciated. Thanks
     
  24. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    There's nothing wrong with your workflow (unfortunately). But the box projected mesh decal has one disadvantage: its GC behavior when dynamically instantiating decals at runtime. This is caused by the fact that Unity provides no low-level access to the mesh data (e.g. using unsafe pointers). Each time the projector needs the geometry data that intersects its projection domain (bounding box) Unity generates a collection/array on the heap.

    When having static decals or simple environment geometry, the Box projection technique is the way to go.
    When having complex environment geometry and/or one have to frequently instantiate a lot of decals at runtime, one of the SSD techniques is more suitable.

    I hope this helped! :)
     
  25. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    How does Easy Decal allow decals to be placed on SkinnedMeshRenders? Does it allow the decals to be attached based on UVs?

    What I would like to do:
    1. Attach a decal at runtime to show blood on a animated SkinnedMeshRenderer.
    2. Be able to setup the detcals at a predetermined the position, rotation and scale ahead of time (this is something I would code myself).

    I guess that I would really like to know if your decals take into account UV's on SkinnedMeshRenderers so they are not moving around when the vertexs move.
     
  26. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Decal projection to skinned mesh works with the current version, but with the following restrictions:
    1. Only one skinned mesh renderer per receiver
    2. Only when GPU skinning is disabled
    The decal gets positioned in 3D (world) space and then transformed into the local model space and weighted according to the present bones. The decal really becomes a part of the skinned mesh. Please write an email to our support when you need access to an evaluation version.
     
  27. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Thanks for the reply...will do that.
     
  28. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello, I have a question do your system works with LUX shader decals, What we woudl to achieve are decals under the snow lux shader has his own decal shader so It should work with your system, But Is there option that you will test that? :) Thanks
     
  29. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Everybody can request an evaluation version. I've sent you a code (in PM) that can be used in our webshop.

    Merry Xmas. :)
     
  30. Ruonan

    Ruonan

    Joined:
    Dec 6, 2012
    Posts:
    53
    Hey, nu-assets

    I got this error. But I our game MainCamera is Set when game start. How Could I go around it;

    upload_2017-12-27_15-12-47.png
     
  31. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Hi there,
    The decal's transform observers get initialized in the component's OnEnable() method. This means that you have to have your main camera set/determined in the Awake() method.
    When working with the source version you could also make the OnEnable method public and call it manually after your main camera has been initialized. When working with the precompiled version (basically the preferred version -> build time) you could also extend the EasyDecal class and write your own initialization chain code.

    Please let us know if this helped. :)
     
  32. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647

    Hello Thank you! Ignore my PM message I didnt know where to use that key :)
     
  33. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Okay! :)
     
  34. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Hi

    I'm having some trouble getting the decals to wrap around the corner of a cube. It has a standard box colider.

    dec_1.jpg
    dec_2.jpg

    Sometimes it doesn't wrap around the edge and sometimes it does but the image is badly stretched. Is this something I'm doing wrong or a limitation of the asset?

    Cheers
    Matt
     
  35. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Basically, you have two different ways to solve this:
    1. Calculate an average orientation according to the involved faces. See the advance bullet hole example for reference.
    2. Constrain the angle in the Constraints tab.
    When working with dynamically placed decals it's all about a clever orientation (and some cheats angle clamping). :)
     
  36. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    One question, can decals be batched by GPU instancing? It does not seem to work...dynamic batching works but not instancing.
     
  37. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Instancing does only work when having a shared geometry, meaning that on mesh gets uploaded to the GPU and gets instanced multiple time. The box projected decal generates a new mesh according to its location and intersecting meshes. Instancing would be possible using a quad decal.
     
  38. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    Oh yeah forgot about that, but why do the shaders have the option at all? for place projection?
     
  39. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Unity provides a simple instancing "API" to enable easy per-instance properties from shaders. So this is basically a default behavior.
     
    Last edited: Feb 13, 2018
  40. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Hi, is it somehow possible to exclude colliders from having a decal projected on it? Other than using the layer Mask, I mean - maybe by using tags, or by adding a component. I'm specifically asking for Box Technique, so it would be okay if it would only work when baking.
     
  41. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    In the current version, this is not possible. But when working with the source (downloadable from our website), you could add the following code to the Project() method of the BoxProjector class:

    Code (CSharp):
    1.             foreach (Collider collider in colliders)
    2.             {
    3.                 GameObject receiver = collider.gameObject;
    4.  
    5.                 if (receiver.tag != "Exclude")
    6.                 {
    7.                     processedIds.Add(receiver.GetInstanceID());
    8.  
    9.                     ProcessReceiver(receiver, 0, 0);
    10.                 }
    11.             }
    But it's not recommended to have this change active at runtime because string operations are not cheap performance wise. Let me know if this solved your issue. :)
     
  42. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Thanks, that seems to be it. I'd actually only need it once, when baking the decal.
     
  43. Blomidev

    Blomidev

    Joined:
    Dec 16, 2015
    Posts:
    11
    Hey again!

    Placing the decals on colliders worked great. Now I'm looking into sorting the decals against unity sprites. My system uses 3d terrain tile colliders with a 2d image at the back representing their visuals.

    In game camera to illustrate the problem
    upload_2018-2-13_23-22-5.png
    Here is the scene view.

    upload_2018-2-13_23-24-25.png

    the road decal should appear on top of the terrain image in the front there. It seems as though all of your decals are sorted at 0 in the default layer.

    I can't find a way to edit their order in layer. One solution is to just set all terrain's sorting layer to one below default - but that means decals will be on top of terrain at all times, when they should technically be under things like cliffs.

    Is there a way I can expose their order via script?

    Thanks,
     
  44. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    Hi! Great looking project!

    You can access the active decal renderer and change the sorting layer there:

    Code (CSharp):
    1. EasyDecal decal = GetComponent<EasyDecal>();
    2. decal.DecalRenderer.sortingOrder = 10;
    Please let me know if this solved your issue.
     
  45. emptybraces

    emptybraces

    Joined:
    Mar 30, 2015
    Posts:
    22
    Hi

    Runtime instantiate is not working when collision object's layer used 31.
    I have try at demo scene "scene_tunnel ".

    Is it bug?
     
  46. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    751
    That sounds weird indeed. Do you get a specific exception message? Are you ale to instantiate other objects on layer 31?
     
  47. emptybraces

    emptybraces

    Joined:
    Mar 30, 2015
    Posts:
    22
    Thanks for reply.
    No message is output. I tried it in an empty project, but it will be.
    When "Environment / tunnel" object layer is 31, decal does not instantiate even if decalPrefab of AdvancedBulletHoles is changed to other prefab.
    layer 30 is fine.
    ImpactParticles are also generated at layer 31.

    I am using the following version.
    Unity 2017.1.2p 4
    EasyDecal 1.6.8
     
  48. emptybraces

    emptybraces

    Joined:
    Mar 30, 2015
    Posts:
    22
    Maybe your implementation of ContainsLayer method is incorrect?
    Would it work out if it is below?

    return (mask & 1 << layer) != 0;

    because,
    Debug.Log(1 << LayerMask.NameToLayer("Test30")); is "1073741824"
    Debug.Log(1 << LayerMask.NameToLayer("Test31")); is "-2147483648"
    If layer 31 is included, it becomes negative.
     
  49. WayneC

    WayneC

    Joined:
    Jan 15, 2016
    Posts:
    13
    Hi nu Assets,

    I'm using Unity 2017.3.1. which the Decal Atlas region editor throws exceptions as follows:
    and more like :

    Could you please see to it because I can't modify the dll.
     
  50. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    Hello There. Are the only shaders that work with Deferred option the Deferred SSD and multiply SSD? I can't seem to get any other shaders to show up when using Deferred decals. Its sort of a necessity to use deferred because I am placing them on a MegaSplat terrain that uses tesselation and Paralax. When using those shaders the decals to appear, but I'd really like my blood decals to have specularity so its shiny and has normal maps rather than just a red translucent blob.
    Thanks!