Search Unity

[RELEASED] Dynamic Decals

Discussion in 'Assets and Asset Store' started by Llockham-Industries, Jan 12, 2017.

  1. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @stephero - The system uses GPU instancing, a color modified can per projectionRenderer without preventing decals from being instanced together :).

    @KamiKaze425 - The bug shouldn't actually manifest in any way, it only occurs in editor. There's a fix in the next patch :).
     
  2. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    83
    Thanks @Llockham-Industries
    What about decals bleeding over edges/corners? Do you support this feature?
    Thanks!
     
  3. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,835
    Deferred screenspace decals in general work differently from the quad-based mesh decals you are referring to. Think of a deferred decals as a box, and where the box intersects with another object, that's the area where the decal gets projected onto the other object. No decal can be drawn without geometry to project it onto. So if you have a deferred decal going over an edge, it will end at the edge. If another object moves into the area of the decal projection box, the decal gets projected onto that objects as well, unless you've set up masking layers correctly to prevent that. There typically also is a value for an angle cutoff so that if you project something onto curved or angled surfaces, the projection will be cut off after a certain angle to prevent excessive stretching (I didn't check if this asset actually has that feature but I assume it does).
     
  4. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    83
    Thanks @Martin_H
    But Dynamic Decals doesn't only rely on deferred decals, since it's written in the asset description "Support for Deferred & Forward rendering paths". Right?

    I have to admit that the store page of this asset if not super clear, since I don't understand if it uses only deferred decals or not.

    So if I use Dynamic Decals with Forward Rendering, it will render the decals using simple quads, which will bleed?
    If I use it with Deferred Rendering, it will render the decals using deferred decals, so they will be fine?
    Thanks
     
  5. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,052
    Hello! Im using UFPS & ICE creature control.. does it work somewhat out of the box to merge with ufps & ICE ? Blood splat & bullet holes in flesh.. and blood on objects if any object is behind character when it hits? ..
     
  6. grujicbr

    grujicbr

    Joined:
    Aug 19, 2014
    Posts:
    18
    Hi,

    i just got the latest version and noticed that now my build times haves increased by more than 1 minute, I looked at the editor.log and found that your forward shaders are taking 30seconds to compile... every time? Is this just S***ty shader compiler by unity or does the shader need to be looke into?

    Compiled shader 'Projection/Decal/Specular/Forward' in 29.93s
    d3d11 (total internal programs: 8640, unique: 5676)
    Compressed shader 'Projection/Decal/Specular/Forward' on d3d11 from 26.60MB to 2.22MB
    Compiled shader 'Projection/Decal/Metallic/Forward' in 33.10s
    d3d11 (total internal programs: 10152, unique: 7188)
    Compressed shader 'Projection/Decal/Metallic/Forward' on d3d11 from 35.55MB to 3.36MB
    Compiled shader 'Projection/Decal/Wet' in 1.00s
    d3d11 (total internal programs: 288, unique: 288)
    Compressed shader 'Projection/Decal/Specular/DeferredOpaque' on d3d11 from 1.16MB to 0.03MB
    Compiled shader 'Hidden/Post FX/Uber Shader' in 45.63s
    d3d11 (total internal programs: 13824, unique: 13824)
    Compressed shader 'Hidden/Post FX/Uber Shader' on d3d11 from 37.87MB to 2.01MB
    Compiled shader 'Hidden/TonemappingColorGrading' in 1.13s
    d3d11 (total internal programs: 522, unique: 292)
    Compiled shader 'Projection/Decal/Additive' in 4.81s
    d3d11 (total internal programs: 1512, unique: 1512)
    Compressed shader 'Projection/Decal/Additive' on d3d11 from 4.19MB to 0.09MB
    Compiled shader 'Projection/Decal/Unlit' in 4.43s
    d3d11 (total internal programs: 1512, unique: 1512)
    Compressed shader 'Projection/Decal/Unlit' on d3d11 from 4.19MB to 0.09MB
    Compressed shader 'Projection/Decal/Multiplicative' on d3d11 from 4.19MB to 0.09MB
    Unloading 436 Unused Serialized files (Serialized files now loaded: 0)
    System memory in use before: 247.5 MB.
    System memory in use after: 228.3 MB.

    Have you looked at this before?
     
  7. davvilla

    davvilla

    Joined:
    Mar 28, 2012
    Posts:
    18
    Hello,

    I just purchased Dynamic Decals and I'm having a lot of compile errors when trying to run the example scenes. Some examples include:

    Assets/Dynamic Decals/Demos/2 Goo/Scripts/ParticleWeaponController.cs(41,44): error CS1061: Type `UnityEngine.ParticleSystem.EmissionModule' does not contain a definition for `rateOverTimeMultiplier' and no extension method `rateOverTimeMultiplier' of type `UnityEngine.ParticleSystem.EmissionModule' could be found (are you missing a using directive or an assembly reference?

    Assets/Dynamic Decals/Demos/1 Minions/Scripts/Ragdoll/Ragdoll.cs(117,36): error CS1501: No overload for method `Instantiate' takes `4' arguments

    I started fixing these manually but more keep popping up.
    I'm using Unity 5.3.8p2 on Windows.

    Would love some help to get things running.

    Thanks!
     
  8. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @stephero - Martin_H is correct, it uses a screen-space technique, it can bleed over the edge if you wish it too (as in bend around the object, not floating out into space), but if it does the texture will not wrap around the edge, rather it will stretch. You can prevent this by adjusting the projection limit, which allows you to clip stretched projections :). The technique is almost identical to deferred decals, just modified to accommodate forward rendering as well.

    @mattis89 - It won't automatically set up what your after for you, but it shouldn't be too terribly difficult to setup what your after, and setting up and learning new systems is half the fun!
    Let's break it down. I assume you would already have colliders on your characters for accurate hit detection, and a projectile that, upon collision, maybe via a ray-cast, deals damage to the enemy. So you would want to attach a ray-printer to you projectile prefab, so it can print when a similarly setup ray collides with a character. This printer could be setup to print different bullet-hole decals based on the tag or layer of the object hit, so you could have different bullet-holes not only for your player and your environment, but also for wood, cement, earth etc. if you desired.

    The tricky part would be having it switch to a bloody bullet-hole after it's passed through an enemy, so blood appears behind them. Again, this could be solved by having an alternate printer (ie. having 2 attached, but only 1 active), and switching active printers on collision via a script (This is the only scripting you would have to do).

    @grujicbr - This sounds like a bug, unless you are re-importing the shaders between builds, or constantly switching platforms. Unity usually only requires you to compile a shader once, and then reuses the compiled shaders each time you re-build. My current understanding and experience is that it only re-compiles the shaders if they have been modified, re-imported, or the platform has changed (thus the shaders have to be recompiled for that platform). It seems your re-compiling Uber shaders as well, so unfortunately I don't think it's specific to my asset or how the shaders have been written.

    @davvilla - Unfortunately the minimum requirement for the system is at least Unity 5.6. This is when a lot of GPU instancing started to become reliably performant. It shouldn't have even let you purchase/download the asset in client in 5.3.8. If you can't upgrade to a newer version of Unity send me an email with your invoice number / details and I'll try arrange a refund for you.
     
  9. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    83
  10. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,052
    Sounds interesting indeed and not soo complicatee actually! What about the decals? What kind can i use with this asset? I have some "live" ones that is not like a dead decal.. smoke or water or blood splat will appear for realism..depends if its flesh, water or stone decal...
     
  11. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    83
    Hi again,
    so I bought the asset. It's a great work, and the demo scenes are really impressive.

    However, I have an issue: Is there a way to control when (in which queue) the decals are rendered?

    My use-case: I need to render my decals OVER a projector. The projectors are always rendered during the Transparent+0 queue and cannot be changed (it's a known-bug in Unity, I reported it 10 months ago, but it's still there...).

    As you can see in the screenshot, the decals are masked by the projector (the projector projects the ugly pink quad on the left):
    Untitled-1.png

    I would like to render my decals during Transparent+1 to draw them OVER my projector.
    Don't suggest to use a Decal instead of a projector, it's not possible because I need a very specific projection and shader for it.

    I linked a unitypackage with a scene showing the issue (import the package in a projector in which DynamicDecals is installed).

    Thanks for your support.
     

    Attached Files:

  12. grujicbr

    grujicbr

    Joined:
    Aug 19, 2014
    Posts:
    18
    Rather strange, i dont change anything, i just click build and run , many times in a row and still continues to build the uber shaders as if teh shader cache is broken. This worked perfectly fine until the import upgrade to the latest version of this.. hmmm can you do a test on your pc and see how long it takes to build a demo scene?
     
    Last edited: Sep 27, 2017
  13. grujicbr

    grujicbr

    Joined:
    Aug 19, 2014
    Posts:
    18
    Yah it is definitely because of the latest upgrade, I reverted your changelist and now im back down to 30seonds (was at 3 minutes 30 seconds before with the patch)
     
  14. grujicbr

    grujicbr

    Joined:
    Aug 19, 2014
    Posts:
    18
    I'm not sure what to think anymore.. i reverted the change, slowly reverted one by one, and eventually ended up back to where i was, and i dont see this anymore O_O unity shadercache must have been broken...
     
  15. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    83
    Hi,

    I wanted to share my feedback and critics after having played with Dynamic Decals during few hours. When I opened the demo scenes for the first time, I was really impressed. But after really trying to use it, my conclusion is that I cannot use Dynamic Decals in its current state. I think there are too many annoying and tedious things to be a convenient and handy tool.

    So most of my comments are about things I found bad. But I still think this asset is really promising. I sincerely hope my critics would be useful, because I really hope you could improve it and make it a really solid solution for decals in Unity.

    Maybe I missed some stuff, but since there is almost no documentation (that's another bad point), that's all I could find.


    The Good

    I really love the fact that decals could work with both Forward and Deferred rendering path.

    The general architecture seems good: having properties stored per Projection asset, and then having each decal instance referring an Projection asset, and being able to customize some properties (like the color) per instance is great.


    VR support

    Right now VR support doesn’t work. Like others have already said, I am spammed by the “UnityEngine.RenderTexture:ReleaseTemporary(RenderTexture)” error message, plus one eye in the HMD blinks in black. It seems to work when you export to a release build, but not being able to test the game in VR in Editor mode makes that I cannot use Dynamic Decals in this state. I am really looking forward to having the next patch!


    Sub UV (UV tiling and offset)

    I think that storing the custom decals UV as instanced values is a very bad idea. First, there is no UI to customize the UV (you have to manually enter the values), but that’s not such a big deal.

    The real issue for me is that, if you want to work with atlases to optimize the performance, you basically have to customize the UV for each decals instance. Or you can duplicate already existing instances, but this makes the management of each “sub-decal” really tedious.

    Plus, changing the kind of projection of a decal breaks the UV….
    DynamicDecals_BreakUV.gif

    Plus-plus, if one day you want to modify your atlas and reorganize you subUV, you are screwed, you need to change every single decal UV!

    IMHO, it would be much better to store the UV in the Projection asset. What I suggest is: in the Projection asset, you could define a list of “SubUV”, each one referred by an ID/index. Then, per instance, you could select which ID/index, without having to retype the UV values. Here is a mockup:
    DynamicDecals_SubUV_Mockup1.png DynamicDecals_SubUV_Mockup2.png


    UI Inspector

    I had a hard time to understand that each Projection asset had a specific Projection type (like Additive, Gloss, etc…). Simply because there is no information about the Projection type when you look at the asset inspector:
    DynamicDecals_Inspector1.png

    On top of that, when you have created a new Projection asset, you cannot change its type anymore (you cannot switch from Unlit to Metallic for example)


    Decals management in the scene view

    The way you place and manipulate decals would really need some work. Right now, the only way to place a decal is to create a new GAO, attach the ProjectionRenderer component, select the Projection asset, and change the Instanced properties (like the SubUV values). Obviously, you can also just duplicate already existing Decal instances, but I really do not see myself manually placing hundreds of decals like that. Here are some thoughts:
    • It would be much much more convenient to be able to place a decal by just clicking on a wall/floor in your scene view (like it works in Valve Hammer, or with QuickDecals2). You could just select the Projection you want in the Project browser, then click on some geometry in the scene view to place a decal (automatically adjusted according to the geometry normal). In bonus, you could choose to randomly set a Y rotation, a random scale, a random Color, or even a random SubUV index (see previous part) according to some ranges to add some diversity.
    • In general, manipulating decals with Unity’s gizmos is quite painful. I think the previous idea would help about that.
    • The Decals gizmos (in the scene view) would need more information. Right now it’s just a cube, and it’s really hard to see in which direction the decals is projected to. Something like an arrow to show the direction.

    Misc


    Like other people already mentioned, the time to export a build drastically increased after integrating DynamicDecals into my project.


    Hope it helps.

    [Edit 1: add Misc part]
     
    Last edited: Sep 27, 2017
  16. dearamy

    dearamy

    Joined:
    Mar 17, 2015
    Posts:
    68
    always get errors no matter what I touch in the decal's inspector
    Decals.png
     
  17. davvilla

    davvilla

    Joined:
    Mar 28, 2012
    Posts:
    18
    @davvilla - Unfortunately the minimum requirement for the system is at least Unity 5.6. This is when a lot of GPU instancing started to become reliably performant. It shouldn't have even let you purchase/download the asset in client in 5.3.8. If you can't upgrade to a newer version of Unity send me an email with your invoice number / details and I'll try arrange a refund for you.[/QUOTE]

    Thanks for letting me know! I had used the built in update but it didn't update my Unity to the latest version. I will try on 2017 later today and report back. Thanks for the quick response!
     
  18. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @mattis89 - What do you mean by type? It includes standard and omni-directional projection types. Unlit, Standard Metallic, Standard Specular, Additive, Multiplicative and for deferred Gloss and Normal projection types :)

    @grujicbr - Good to hear the issue resolved itself. Unity does have it's quirks :).

    @stephero / @dearamy - Error will be fixed in the next patch (send me an email if you want an early version (Support@LLockhamIndustries.com).

    @stephero - I love your idea of storing different projection tiling and offset values in the projection! Will definitely be implementing, likely with an atlas selector UI (though I have a lot to do before adding new features). Projection type switching is a grand idea, as well as having a direction indicator. Nice feedback! Thanks :).

    The system does have a placement tool ( Window>Decals>Placement ) though it could definitely use more love, brushes and the like.
     
    stephero likes this.
  19. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,052

    I dont really get this whole projection thing to be honest.. What am I projecting if it comes to blood decals? I know what "standard" decals is but, to project them?
     
  20. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    Im getting the same issue as dearamy in 2017 also.
     
  21. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    354
    Any idea when a fix would be avail either for VR? I’m still using 1.6 and want to upgrade.

    Just curious... don’t want to rush you :).
     
    Llockham-Industries likes this.
  22. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @sbmhome - Send me an email and I'll give you a build to try, should fix the render-texture issue, though It still has a way to go before being viable on high-fidelity VR games. If you have complex detailed scenes, the current way shader-replacement is being performed is too expensive, and it needs to be done per eye, so any minor discrepancy is exaggerated. I'm trying to find workarounds and have already got a few successful optimizations included, and a lot of ideas I'd like to try. A lot of this is experimental so it's difficult to give time frames but I'm aiming to submit a new patch mid-October that should optimize across the board :).
     
  23. DiggingNebula8

    DiggingNebula8

    Joined:
    Oct 2, 2016
    Posts:
    21
    With a proper understanding of this asset, can I build something like The Unfinished Swan? @Llockham-Industries
     
  24. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @DiggingNebula8 - How have I not found this game until now? Really cool concept for a game! I don't see why you couldn't build something similar to The Unfinished Swan. It wouldn't even require proper understanding of the asset, you could probably do it with just the included components. And, as decals use GPU instancing, you could likely do it at a much higher granularity if you desired (ie. have many smaller decals, instead of fewer larger decals, making it easier to navigate) :).
     
    DiggingNebula8 likes this.
  25. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    194
    I have a question regarding what @DiggingNebula8 asked, I just found the game too and its a really interesting idea to explore, but I wonder how they managed to make the decals work, because those decals seems to have a sort of enveloping projection more than a linear planar projection over the surfaces, you can tell that one a ball hits a corner of a room the decal has half of the texture in the ground and half in the wall, without stretching, like if it was a mesh decal or something like that, can you explain what could be going on there and if this behaviour is possible with Dynamic Decals @Llockham-Industries ?
     
    DiggingNebula8 likes this.
  26. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    194
    my guess is that the actual textures of the meshes are being modified, the meshes are correctly UV mapped to allow this (you can see problems with the seams in some meshes like rocks or trees), so maybe what they are doing is changing the textures of objects at runtime? doing something like a raycast, taking the uvPos of the hit, and maybe using some tech feature like unity's custom render textures to modify the textures really fast?
     
  27. DiggingNebula8

    DiggingNebula8

    Joined:
    Oct 2, 2016
    Posts:
    21
    Thank you so much, I have purchased the asset. We have a very new and unique game concept, with the help of your asset, we could concentrate on other things, cheers.
     
    Last edited: Oct 4, 2017
    Llockham-Industries likes this.
  28. adriansotov

    adriansotov

    Joined:
    Jul 14, 2015
    Posts:
    8
    How can I solve the Attempting to release RenderTexture that were not gotten as a temp buffer error?
     
  29. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @Cleverlie - It looks like its storing points in world-space, and using something similar to splat-mapping. you could imitate this/improve on this by using multiple projections. You would have your initial projection, much smaller that hits on initial collision. Then have it play a particle effect on collision that emits particles out in a hemisphere, the particles themselves would dissipate/shrink rather quickly, over say a meter. These particles could then print other small decals on collision. This gives you significantly more accurate "Splashes" that can also hit backfaces and would wrap around objects more accurately, as well as a nice particle effect :).

    @adriansotov - Send me an email, I'll send you an early fix :). (Support@LlockhamIndustries.com)
     
    Cleverlie likes this.
  30. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    194
    that's a nice suggestion, thanks! with GPU instancing it shouldn't be a problem to intanstiate dozens of decals per "big decal".

    also I just wanted to share that I solved the "range visualization" thing by doing something completely different than decals, I did a nasty trick with rendering three similar spheres on the same position at the same scale, each one as a different "pass", the first renders itself with Ztest greater so i renders whatever is behind depth map, then the next spheres render themselves with different stencil buffer and zTest configurations and I ended up with this.

    cvcvcv.jpg

    only wasting 3 drawcalls on it fortunately, using ASE to do the shaders.

    anyways I hope your asset keeps growing and I'll keep eyes on the updates to see if you manage to solve the batches problem to use the asset for blood splats/explosions/etc.
    cheers!
     
  31. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    619
    Hello @Llockham-Industries

    Hopefully this isn't a silly question, but after reading the product description and skimming the forums, I haven't seen any mentions of using DD for static decals, and more importantly, would it be a performance waste to use DD for static decals that will never change? Or should I consider another decal option? Thanks for reading, and this looks really cool. Just your demo video inspired a few game ideas ;)
     
  32. SNS_Case

    SNS_Case

    Joined:
    Oct 7, 2011
    Posts:
    54
    Hey there @Llockham-Industries ,

    I picked this package up yesterday, and it has made adding dynamic decal FX quite simple and enjoyable. The value in this package is immediately noticable! However, I am currently running into an issue where the first time a projection is placed/rendered, all billboard particles suddenly become locked and no longer face the main camera.

    I am using the particle collision printer for blood FX, and all particles in the scene are on a layer that is set to be ignored by the instanced mask on the renderers. The printer is set to print behaviours, use its own "Blood" pool, parent is set to default, and rotation source is velocity (otherwise, it's the same as the blood printer/projections provided in the demo). I'm on Unity 2017.1.0f3, any help you can offer is appreciated!

    Edit: side note, but I noticed that the pooled instances do not retain tag/layer settings from the prefab.
     
    Last edited: Oct 13, 2017
  33. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @lod3 - Unless you're also using the system for non-static decals as well, you would be paying an overhead to have your decals dynamic. The decals themselves would be roughly as expensive as mesh based decals, GPU - instancing might be a little faster than dynamic batching, but probably not to a noticeable degree. But you're paying an overhead for the requisite shader replacement the system uses. That said, if your already using the system for blood etc. your already paying that overhead, so it's perfectly fine to use the system for static decals as well (Though as it's screen-space it doesn't support lightmapping, if you need lightmapping you'll have to use a mesh-based solution).

    @SNS_Case - Hey, this is a known bug, Unity are actively working to fix it. It occurs when billboarding particles cast shadows while any rendering is performed in OnPreRender(). In 90% of the cases people have reported this bug they weren't even aware they had shadows turned on in their particle systems, so your first option is to turn off your particles shadows. If this isn't an option I have a workaround that will work in all use-cases except MultiPass VR. Send me an email at Support@LlockhamIndustries.com and I'll send you a fix.

    Also got your layer/tag request/fix, it'll be in the next build, nice find! :).
     
    SNS_Case likes this.
  34. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    619
  35. SNS_Case

    SNS_Case

    Joined:
    Oct 7, 2011
    Posts:
    54
    Thanks for the response, you're right, I hadn't realized shadows were on on those particles and I wasn't aware of that bug either. I'll be fine turning off shadows and waiting for the official fix in the instance I keep some of the particle's shadows on. :)

    Thanks again for the great asset!
     
  36. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,402
    I was wondering if dynamic decal can be use / modified to simulate under water caustics effects. The animation for the actual caustics can either be done by overlapping two scrolling textures or frame animation, but my question is more to do with deferred decal's projection issue where it only does one direction. Any ideas? If this works, then it is going to be much more effective solution than using Unity's projector because of obvious less draw calls and so on.
     
  37. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    662
    @Llockham-Industries Hi, just updated to the latest version and now I see this.

    Screen Shot 2017-10-20 at 10.43.23.png

    Unity 2017.2.0b10
     
  38. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @castor76 - You might be able to make a 3-dimensional projection that takes the world space position reconstructed via the projection and samples a noise function to fake it? But it wouldn't be very accurate, so you would need to spend a lot of time setting it up to somewhat match the waves overhead. If you want to go down this route I'll be happy to help you set it up, though I don't have a ton of experience in caustics so you'll need to research and set up the noise functions in shader yourself. Send me an email (Support@LlockhamIndustries.com) if you need help :).

    @Griffo - Could you try a clean install? (Of Dynamic Decals) it looks like the shaders haven't imported or updated correctly. Cheers :).
     
    Last edited: Oct 20, 2017
  39. LasseWestmark

    LasseWestmark

    Joined:
    Mar 18, 2014
    Posts:
    12
    Hi, I'm researching whether deferred decals will be a good fit for our project.
    I've played around with the basic deferred decal system from the Unity documentation and noticed that if the camera near plane goes inside a decal bounding-box then the decal disappears. Is this something you have fixed in your implementation or is it something inherent to deferred decals in general?
    Our project demands that the camera can get very close to decals on very organic objects(read non flat).
     
  40. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
  41. LasseWestmark

    LasseWestmark

    Joined:
    Mar 18, 2014
    Posts:
    12
    Ahh just realized that it's actually using a box mesh. But having "Cull Off" in the shader doesn't help much as the backfaces are already behind the object the decal is drawn on.
     
  42. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @LasseWestmark - ZTest Always should prevent it from being clipped by objects behind it (but in front of your backfaces), use with care. :)
     
  43. Crazak

    Crazak

    Joined:
    Aug 30, 2012
    Posts:
    1
    Hi there!
    We bought this asset last week, and it works fine, although we have a small issue with it.
    When I use this on the PC version of our game, it works fine, no problems... If I switch the build settings to Android, I get the following error on the console everytime I manipulate any decal on the editor:

    Attempting to release RenderTexture that were not gotten as a temp buffer
    UnityEngine.RenderTexture:ReleaseTemporary(RenderTexture)
    LlockhamIndustries.Decals.DynamicDecals:ReleaseTextures(ShaderReplacement) (at Assets/Dynamic Decals/Scripts/Core/DynamicDecals.cs:975)
    LlockhamIndustries.Decals.DynamicDecals:postShaderReplacementStart(Camera, CameraData) (at Assets/Dynamic Decals/Scripts/Core/DynamicDecals.cs:789)
    LlockhamIndustries.Decals.DynamicDecals:postRender(Camera) (at Assets/Dynamic Decals/Scripts/Core/DynamicDecals.cs:685)

    It seems to work anyway, but this makes it very hard to debug and work with the decals...

    Is there something we can do? Is this a known bug?
     
  44. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @Crazak - Hey, this is a known bug, I'll be uploading a patch soon with a fix as well as well as some optimizations. Send me an email (Support@LlockhamIndustries.com) and I'll send you it early :).
     
  45. ZKTECH

    ZKTECH

    Joined:
    Dec 29, 2015
    Posts:
    2
    WTF
    No Decals = 60 Frames
    5 Decals = 36 Frames

    No Decals 0.1 % Camera.FireOnPreRender
    With decals 26,8 % Camera.FireOnPreRender
     

    Attached Files:

  46. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @ZKTECH - Yea that's definitely a significant outlier, something must be conflicting with the shader replacement. There will definitely be a cost, but it shouldn't be that significant. I have a demo scene of similar complexity that runs at a quarter of the main thread time. Can you please send me an email at Support@LlockhamIndustries.com with the following.

    - Deferred or Forward
    - Static or Dynamic batching
    - OS
    - Build target

    I have a build I'd like you to try as well, with a few significant optimizations that hit corner cases. I'll send you it via email.
     
  47. davysw

    davysw

    Joined:
    Jul 15, 2014
    Posts:
    17

    Is there any chance this will be patched in some way later so it doesn't cause massive drag? I've been having the same issues. It's okay sometimes in lighter scenes (though it got really bad once particles got added), but when I'm in a dense scene with a lot of geometry it adds a ton of batches.
     
  48. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @davysw - This is starting to sound like a broken record, but Scriptable Render Pipelines will allow us to fix this. It should allow us to perform shader replacement with a specifiable set of lights, or rather, without lights. So static batching can run properly without being split by lighting. It's looking more and more promising. here, here & here.

    I'll be starting to build experimental custom pipelines or methods that can be injected into users pipelines, after the release of the next build, for people who are interested in using this early. I've slowly been redesigning the system with it in mind since 1.6, moving away from command buffers, manual culling and fixed rendering and towards native rendering, so hopefully, it shouldn't be too much of an overhaul :).
     
    hopeful likes this.
  49. Mijail_Bitboys

    Mijail_Bitboys

    Joined:
    Apr 22, 2015
    Posts:
    146
    Hello sir. First congratulate him on his asset. From the first moment I saw it in the store I knew I had to use it in my project and luckily I bought it justl when it was on sale!
    I still have not had much time to prove it in depth but I have bookmarked your website to start learning how to use it.

    The fact is that among other things, I would like to use the system to project bullet holes and I would like to know if there is an option to fade the decals after a few seconds and then deactivate them. I mean throwing them from a pooling system etc ... Thanks for your time.
     
  50. Llockham-Industries

    Llockham-Industries

    Joined:
    Aug 4, 2013
    Posts:
    262
    @Mijail_Bitboys - Check out the Goo demoscene. It demonstrates how to fade out projections using the Fade component as well as print projections (It prints based on particle collisions but there are other printer options available). :)