A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by Llockham-Industries, Jan 12, 2017.
Nice! That sounds promising. I'll take a look, thank you very much.
Hi. I'm getting this problem with one of my menu scenes. The scene was running completely fine but today it seems DynamicDecals.LateUpdate() is causing a huge spike and making my game unplayable. The scene is just UI, no 3D elements in it, so there is no decals placed in the scene and that makes me confused as to what it could possibly be doing with no work to be had. I'm using Unity 2017.2. I've checked for any hidden objects and also created a decal then deleted it to see if maybe it was a clean up issue. No avail. Any idea what this could be?
Edit: I've turned on Deep Profile and it seems it's related to Resources.Load()
Edit 2: I've found the culprit, it is in DynamicDecals line 650 (I believe). You are constantly calling Resources.Load() and it is having an adverse effect while in play mode. I added if(!Application.isPlaying) as it seems to have no effect when in edit mode.. Obviously I can't edit the settings in play mode now but that doesn't bother me. Maybe instead of constantly reloading the settings file you can add a function that calls something like ReloadSettings() when anything is updated from the settings editor script?
//In editor settings subject to change. Update constantly
settings = Resources.Load<DynamicDecalSettings>("Settings");
I have the same issue as ZKTECH where the Camera.FireOnPreRender taking a lot of time. Could this be a bug? Has the decal system been tested on a proper full project? I was about to change decal system since it not possible to have Camera.Render time doubled for some decals.
Edit: Looking at the demo scenes in an empty project the Camera.FireOnPreRender still seems to be around the same as Camera.Render.Drawing, if the Drawing goes up so does the Camera.FireOnPreRender. So basically the decal system almost doubles the Camera.Render time no mather how many decals you have.
@ModularBuilds - It's unusual that loading such a small file is causing such a massive performance impact, but it's highlighted an unnecessary inefficiency regardless. I've made the change you suggested, only requesting a reload when required, it will be in the next release . Thanks for the feedback!
@Filhanteraren - The system is built on shader replacement, so naturally the more you have to render normally, the more you will have to render via shader replacement as well. Currently in Unity shader replacement is performed by setting up another disabled dummy camera and having it draw the current scene with a specified shader. This feels like a bit of a hack, and I think Unity recognize this as well. Right now this means the duplication of culling and batching work as well as generally setting up a camera to be rendered, which shouldn't be required (As this should be re-usable from the original camera). Most of the actual draw submitting to the GPU (the work that's actually required) is thankfully done asynchronously on the render threads, so this is not so much of an issue.
Unity is addressing all of this with Scriptable Render Loops. I'm working towards compatibility now. They will allow us to inject the shader replacement into the original cameras render loop, instead of setting up a duplicate camera and thus, duplicating the setup, culling and batching .
Hey, just bought your asset - really excited! Looks professional and feels fast after my initial testing! I was wondering if there was an easy way to randomize the size and rotation of decals so that as a character walks, we can place randomly rotated and sized corrosion decals (I found rotation but not size). I'd also like to be able to randomize time between placements - I'm currently using the collision printer with a time interval
In addition, would there be an easy way to add a behavior to a decal when it's printed?
EDIT: Okay, I found the 'Print Behaviors' checkbox, which will work worst case - would it be possible to add some type of selection of behaviors that can be added when a decal is printed? So that I can have separate behaviors on the main renderer and the rendered decals?
I just bought this Asset because i need a good and performant decal system for all the blood flying around in my mobile game =)
I attached a Ray Collision Printer to my first person shooter guy and it prints a blood decal everytime the player shoots. So far so good, but there are really strange things going on in the profiler. My Draw Calls and Tris suddenly explode, even with only one single Decal on the screen, making it unplayable on mobile. What am i doing wrong?
@zornor90 - You may have to extend or create a custom printer to randomize the time between placing your decals, or you could use the ray printer and call it's print() method at random intervals from an external script. You could use the randomize scale script to randomize the size of your projection on print, and the rotation can be set to randomize within the printer itself. You can also use the fade script to fade your corrosion details in very quickly, it's a small touch but it looks significantly nicer.
I'm not I understand the second part of the questions regarding separate behaviors. The intended use is to attach behaviors to a decal prefab and set that prefab to be printed in the printer. It won't print any behaviors attached to the printer itself.
@Doodel - Could you send me an email at Support@LlockhamIndustries.com with the package debug info.
Debug info can be found in the decals settings menu while the editor is in play mode (Window>Decals>Settings). There's definitely something unusual happening, I suspect you have a few thousand decals being printed over the top of each other in place, and it simply looks like a single decal? It would account for the saved batched calls and the additional 20k tris. Could you also try manually placing a single decal and disabling your printer?
@Llockham-Industries I've been using Dynamic Decals for a while now, and today I upgraded to 2.02.
Things are a bit different now, with the projection assets, etc., and I've figured most of it out.
However, I'm unable to recreate what I had before: overlapping normal map based decals. The way it used to work, I could select Normal Map as the decal type, no Albedo. Then, in addition to the assigned normal map, I could:
1. Use a shape texture (a mask) to specify the effective area where the normal map should apply.
2. Use some kind of alpha slider to blend between this decal and other decals / terrain below it.
With the new system, if I place a normal map decal, it cannot be blended with nearby normal map decals or the underlying terrain in any way - the rectangular shape totally wipes out / overrides the overlapping nearby decals and terrain normal map.
Am I missing a setting or something?
Please note, I can't use an albedo map's alpha channel for this, because I do not wish to apply any RGB to these decals - they simply deform the underlying terrain - like tread marks, foot prints, etc... and they need to overlap to some extent.
Would it be possible for the generated decal camera to skip rendering shadows? If the user only uses unlit decals, I don't see how this should be necessary... (but I am no expert )
@mgeorgedeveloper - This was actually a conscious choice. I had more complaints of people trying to remove the normal details from underneath there decals, so I removed them from the shader replacement. The solution in your email is actually a really nice workaround. Eventually, I'd like to render both a detail normal and base normal buffer and give the option to use a blend of the 2 as the base normal for your decals (On which the decals normals would be applied and written to screen / deferred buffer), but currently, this requires an additional buffer and would result in additional replacement passes in some scenarios. For now, I can definitely add back in the "Shape" mask to the deferred normal decals, I have another customer requesting this as well, I've been trying to get it done for a while.
Edit - Sent you a copy with Shape masking included, check your email .
@alexandre-fiset - The generated cameras used for replacement passes do skip shadows. They still have the shell commands that set up and clear the shadow buffers. This is unavoidable in the current way Unity support shader replacement; But is of negligible expense. They do not actually draw anything into any shadow of the shadow buffers .
Hello! I'm really interested in buying this plugin. I have one question, though. The page says that it has a "Support for Deferred & Forward rendering paths & all shader models". Does it mean that we can use our own shaders or are we stuck with pre-defined shaders that come with it?
@Kolyasisan - The system is dependant on the sorcery in the shaders it uses. So in short no, but; If your competent writing shaders it's not too hard to modify those included, and you can duplicate projection types within the system and hook them into your own duplicated (But modified) shaders, and the system will automatically pick them up and work with them. So it's possible to add your own projections with your modified shaders, but you'll need to know how to write frag/vert shaders.
Thank you for your answer.
I have a very clean wall texture and want to add some dirtiness, like dirt / stains.
Would this be the right solution or would a detail map be a better choice?
I just got this and is fantastic! wondering if can be attached to a character?
If the character move, it still attached to it?
In our project, the amount of time spent in CollectShadows from these cameras is similar to the one from our main one. In fact, in a scene with only a plane, cubes and some shadows, enabling one decal results in nearly doubling the GPU time. I've tried many things to reduce its overhead without success (currently two "Custom Camera" take 2.5ms each on the GPU, for only two decals rendered).
Hi, Is there a way to make a blob shadow with Dynamic Decals following by my car.
I have tried it, but seems there's no multiply decal materials, i guess multiplicative may works, but I only get something like this:
And my texture is:
I would like to get something like this:
(This was done by unity default Projector)
Can Dynamic Decals achieve this effect?
This is a great decal system, overall.
However, I bought it for use in a Rift project. Everything looks fine in the game view, but inside the headset, every time a decal is created/destroyed, the Rift camera flickers, like a quick 'blink'.
This makes is unusable in my project. Is there a fix for this?
@Exeneva - The system can certainly support details, but if you're just doing walls you could easily get away with quads or some of the free decals system on the store. This system is targeted more at advanced decals. Decals that need to be moved and generated at runtime. You can use this if you like, but there are free alternatives available .
@ratonmalo - Decals can move with characters, simply parent them to the characters bones like you would any other gameObject .
@alexandre-fiset - The system currently calls an entire render-loop per mask layer (As mask objects need to be rendered separately). There does seem to be a small overhead per camera, though in my case it's only about 0.25ms each, while the main is about 1.4ms (Obviously will vary per device). Do note that the shader replacement performed is once (divided per mask group), not per decal. So you can have as many decals as you would like, reducing the number of masking layers in use will reduce this overhead though .
@iileychen - Hey nice find. Didn't take into account the blending operation for the multiply decals, send me an email (Support@LlockhamIndustries.com) and I'll send you a fix .
@toxicfrog - This one sounds like it might be tricky to track down, especially as I use a vive for testing, not a rift. Could you send me an email (Support@LlockhamIndustries.com), I have a build I'd like you to try to test the camera rig your using, as well as provide some debug information.
Will it work on terrain with tesselation or parralax shader?
@kubaskia - It will work with Parallax shaders. Tesselated shaders will cause issues though, as shader replacement can't account for the detail created by tessellation. This will result in the decals drawing over tesselated surfaces as if they had not been tesselated (ie. you would lose tesselated details where decals are drawn).
@Llockham-Industries awesome, turning it into a prefab did everything I needed it to! System works great with no slowdown!
@Llockham-Industries Thanks for the quick fix, the car shadow with Decal multiplicative works in Unity Editor now, it renders well, But after i build APK, run on my android, the shadow disappear, what can I do for android platform?
I'm not competent writing shaders (or doing anything with shaders except assigning them to a material). Can you give me quick thoughts about how feasible it would be to make these decals work with Imperial Fur shaders? https://assetstore.unity.com/packages/vfx/shaders/imperial-fur-pbr-32522
@Llockham-Industries I've been working on a system with dynamically drawn meshes (using Graphics.DrawMesh() with the camera parameter set to null), and the decals don't appear to be drawing on these meshes. If I place a mesh manually in the scene at the same location (or slightly behind, even), they are then drawn (and, in fact, while their locations are on the standard mesh, they still draw above the dynamic mesh). Is it going to be possible to draw on to these meshes? Or, potentially, do I need to set things up in a different fashion?
@iileychen - Interesting, it's possible Android devices don't support blend operations, could you try with an unlit decal instead? The system should definitely support android devices, I'll run another test on my s6.
@gecko - I myself would have trouble implementing fur shaders as decals. Even if the author were to sit down and explain exactly how he was achieving the fur. Unfortunately, I'd say it's pretty unfeasible.
@ChrisDirkis - The problem is definitely that the submitted meshes aren't being rendered into the requisite shader replacement. So the decals are being drawn as if they are not there. When are you submitting the DrawMesh command? It's possible your doing it after shader replacement, but before standard rendering.
Ok, i'll make a test with unlit decal.
BTW, any tips for optimize on mobile?
Here's a comparison of trigs&setpass calls between with decal VS no decal:
You can see if I disable the decals(two simple decal), there's about 20k trigs and 40 setpass call differences.
Without that, my game can runs fully 60fps on my mobile but when decal added, it dropped to about 40fps, which is huge. So any tips?
Tested, unlit decal blend/cutout is not shown on my android either.
I have the same issue as you as when i add decals the drawcalls go up an extra 200 just by adding 2 decals
Sorry for the ask but I'd like to clear myself about the compatible shaders.
I'm not a shader writing guru so I use Amplify Shader Editor to create my custom shader.
Are your decals compatible with Amplify Shader Editor shaders?Or it depends on what shader I'm creating on?
Thanks in advance
Hi @Llockham-Industries , I got the same problem as @iileychen after upgrading to version 2.0.3:
- Decrease frame rate.
- Base/Unlit decal doesn't work on my android device (Samsung A5).
Hey @Llockham-Industries , I managed to narrow down the issue my project was having with the decals and it seems to be that the dynamic decals do not work properly when there is a terrain in the scene that uses the unity tree system as it causes a large increase in draw calls due to the following error : Objects have different MaterialPropertyblock set. Which is what unity uses to add variation in the trees.
I really like this system, but the performance hit compared to Unity's Projector is pretty big. As soon as I have a decal in the scene, it adds about 3ms cpu time, which cuts my framerate down considerable. If I understand right, it's 'cause it's adding another camera to my scene, for all intents and purposes, right?
I saw in a previous post:
"Unity is addressing all of this with Scriptable Render Loops. I'm working towards compatibility now. They will allow us to inject the shader replacement into the original cameras render loop, instead of setting up a duplicate camera and thus, duplicating the setup, culling and batching"
Is there an estimated time for this update, and will that address the performance issues?
@Llockham-Industries I'm doing it in a coroutine, so in theory, after the standard Update but before LateUpdate. I've also done some messing around with script execution order, but in theory, that should be per-function, not per-block (I hope). When does the shader replacement occur?
@iileychen / kotis21 / Looking4Game - I've almost got android working again. The new packed replacement mode I built to optimize VR isn't compatible with Android, though I'm still trying to figure out why. For now, you can disable it by commenting line 1114 of DynamicDecals.cs. Though it doesn't appear to be working perfectly. Again, working on it.
@marcatore - They system currently only functions with the included shaders. If you know how to write custom shaders you can build your own to extend the system, but you'll need to be able to write vert/frag shaders yourself from scratch. Amplify etc. won't do what we need here.
@kotis21 - It's definitely possible trees aren't being batched correctly in the replacement shaders. Unity's current system falls apart in a lot of corner cases.
@ChrisDirkis - It's possible it only sends the draw commands to enabled cameras, and, as the replacement cameras are disabled and drawn manually, they don't receive the commands. The shader replacement occurs in OnPreRender(), so after lateUpdate etc. We could go try to inject these commands into the manual camera explicitly, but I think it would be easier to simply wait for scriptable rendering pipeline support, which should just get these commands themselves.
@Dr_Fragg - You are correct. The additional fake camera renders the scene. This means culling, batching etc. has to be performed again for this camera to render the requisite replacement buffers. Unity's shader standard replacement is built into the original camera and shares all this data, which is why it is significantly faster. The current solution also falls apart in a lot of corner cases. Scriptable rendering pipelines should give us similar performance to the in-built shader replacement. I'm not sure when Unity plan to officially release it, but they have unofficial versions I'm beginning to work with now.
So, any suggestion of optimizing for mobile?
I did some more digging on the lengthy compile times in my project that appear to be a result of DynamicDecals. I made a post earlier some time ago and I thought it was my issue but it appears to be coming from the one of the updates to dynamicdecals. In one of your updates, you switched to always including Unitycg.cginc to get a bunch of common functions, but this has a side effect of increasing compile times, because it ends up recompilinga lot of shaders for no reason (because unity... reasons...).
This is actually a very common issue, which is why its recommended to simply not include Unitycg.cginc but instead take out the things you need from there and have your own custom file. I know that unity is also aware of this issue, but if you ask me, the increased compile time due to shaders is a pretty big negative to me right now. It increases my creating package time from 30s to 3 minutes and 30 seconds because of shader compiling which makes making a multiplayer build almost impossible as I have to wait very long. I highly suggest removing the unitycg.cginc include to fix this.
Hey, I downloaded the newest version and I'm getting a build error:
Any ideas what might be causing it?
EDIT: I went ahead and deleted the shaders causing the issue as a temporary fix - I can build now, but get random errors now whenever the system tries to use the forward shader, which doesn't make sense to me since I'm using deferred lighting
Just bought the asset and got this error too!
I have the same build errors. I can only build the game when I remove the asset which makes it hard to use it.
Unity Version: 2017.2.0f3
PS: As another temporary workaround you can remove d3d9 from the build.
- remove the checkbox from "Build settings / player settings / other settings / auto graphics api for windows"
- remove Direct3D9 from the list
Fix for DirectX 9 errors, just delete the old shaders file in the resources folder and unzip the attached shaders. My apologies. Still working on the Android fix. Though if your building for Android, send me an email (Support@LlockhamIndustries.com). I'll send you a fix the moment I get through the last of the quirks.
@grujicbr - Thanks for the suggestion! I also need to work on reducing shader variants, I think this is the big killer at compile time. There are so many required to support everything Unity offers optimally. I might rewrite the projection class to support multiple shaders; Then separate shaders into different groups for different approaches to shader replacement. Then I could have the obscure ones zipped up, and allow users to only unzip/use what they need. Avoiding compiling of unrequired shaders. Ideally, I could just have zip folders for different platforms/ Build targets. Android/IOS, Windows/Mac, VR etc. With forward and deferred variants. All the actual code is sitting in cginc. so it would only mean recreating the shaderlab files.
@iileychen - I'll try work in an option to force Classic shader replacement. This would use Unity's low precision shader replacement, which is much faster. Also, avoid using masking where possible, or use as few layers as possible. Currently, it does come with a minor performance hit.
Okay, I have a fix for Android builds that work without artifacts or quirks. Found and fixed a few issues with various mobile GPU's while I was at it. It'll take a few days to get the build-up, and I would like to pack a few more things into the next update, instead of constantly pushing to the asset store. So if you'd like a copy of the fix immediately, send me an email (Support@LlockhamIndustries.com) and I'll send you a fixed build .
Yes that would be much appreciated, currently it is a pain in the ass to build the package, I can't afford to actually build the player non-stop, so i have to use workarounds...
Thanks for the fast shader fix
Hi, I've just bought an asset and I can't find any information about license. If you have one could you link it in the assetstore? What are the limitations?
Can my team use it for the project without buying over 9000 licenses for every person in team (scenario: only I have access to download the asset (so any other project if I'm not a part of it won't have access), but people who have access to unity project can use it)?
For example, me and my friend we are developing a game, I code, he does game design and edits levels, I can use the asset to code spawning of blood etc. , he can use it to place some custom decals on objects.
Or for example, only I use the asset, but game designer has access to project, but he doesn't touch the asset.
Also, if I work on a game jam in a team but we are not in the same physical location and they haven't bought your asset, but I want to use it in a project can I do so (clearly they won't have access to any future updates if they have access to current unity project, and they could find a pirate version on the internet anyway, but they wouldn't be able to use it legally)?
The unity "one license per seat" on assetstore is confusing and usually every asset has it's own license of use.
Thank you, the asset looks amazing, I haven't had time to test it yet, but it looks like the best one I have ever seen.
Spring (2018.1) Although Unity can move it so YMMV
It means one copy of the asset must be purchased per copy of Unity that will access it. If two unique licenses Unity are being used with it, you need two asset licenses.
So if 9000 people were using it at the same time, then for sure Llockham Industries is going for a holiday in the sun. Usually though authors will offer bulk licensing for companies.
Thanks for the clarification,
I didn't mean to be rude while saying "over 9000" - it's just a meme. What I meant is what if the other person doesn't even use that asset, but he needs access to the project?
It's fair to pay 300$ for 10 people using the asset - that is for sure. Usually, though, only 2 people out of 10 would use that asset.
And how would you know if designer had access to unity project or not? What if he doesn't use that asset but he has to do some level design work without asset even being touched?
And about game jams might seem irrelevant because usually you can't use paid assets.
Sorry but there's no way around it. If 3 copies of Unity are being used at the same time, you will have needed to buy 3 licenses or negotiate with the author for a separate license. It's a really widely used license and well understood in this industry.
After Updating from 2.0.2 to 2.0.3 I started getting errors
NullReferenceException: Object reference not set to an instance of an object
LlockhamIndustries.Decals.Fade.Begin () (at Assets/Dynamic Decals/Scripts/Modifiers/Fade.cs:80)
LlockhamIndustries.Decals.Modifier.OnEnable () (at Assets/Dynamic Decals/Scripts/Modifiers/Core/Modifier.cs:45)
LlockhamIndustries.ExtensionMethods.GameObjectExtensionMethods:AddComponent(GameObject, MonoBehaviour) (at Assets/Dynamic Decals/Scripts/ExtensionMethods/GameObjectExtensionMethods.cs:26)
LlockhamIndustries.Decals.PoolItem:Initialize(ProjectionRenderer, Boolean) (at Assets/Dynamic Decals/Scripts/Core/ProjectionPool.cs:254)
LlockhamIndustries.Decals.ProjectionPool:RequestRenderer(ProjectionRenderer, Boolean) (at Assets/Dynamic Decals/Scripts/Core/ProjectionPool.cs:134)
LlockhamIndustries.Decals.ProjectionPool:Request(ProjectionRenderer, Boolean) (at Assets/Dynamic Decals/Scripts/Core/ProjectionPool.cs:114)
LlockhamIndustries.Decals.PrinterrintProjection(ProjectionRenderer, Vector3, Quaternion, Transform) (at Assets/Dynamic Decals/Scripts/Printers/Printer.cs:197)
LlockhamIndustries.Decals.Printerrint(Vector3, Quaternion, Transform, Int32) (at Assets/Dynamic Decals/Scripts/Printers/Printer.cs:174)
LlockhamIndustries.Decals.RayPrinterrintOnRay(Ray, Single, Vector3) (at Assets/Dynamic Decals/Scripts/Printers/RayPrinter.cs:32)
NullReferenceException: Object reference not set to an instance of an object
LlockhamIndustries.Decals.Cull.Perform () (at Assets/Dynamic Decals/Scripts/Modifiers/Cull.cs:44)
LlockhamIndustries.Decals.ModifierManager.Update () (at Assets/Dynamic Decals/Scripts/Modifiers/Core/ModifierManager.cs:108)
Has anyone seen this?
I was able to figure out that this is the Cull Modifier. If you take the #2 goo demo and remove fade on the decal and replace it with Cull what will happen is the first batch will work. Then turn away and let them cull. Then after that every decal will fail when created with these crashes.