Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[RELEASED] Dynamic Decals

Discussion in 'Assets and Asset Store' started by DanielDickinson, Jan 12, 2017.

  1. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    Hi, I import your decal system in my project and I get this error:

    Assets/Dynamic Decals/Demo Scenes/!Components/DemoSM.cs(155,16): error CS1061: Type `Button' does not contain a definition for `onClick' and no extension method `onClick' of type `Button' could be found. Are you missing an assembly reference?


    DemoSM.cs has using UnityEngine.UI; at the top so I am lost. Anyone got this problem?
     
  2. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    An other problem, my project crashes and Unity exit about every 1-2 hours when I save generally. It seems to come from your code. Here is the log from Unity
    Code (csharp):
    1.  
    2. UnityEngine.Camera:RenderWithShader(Shader, String)
    3. DynamicDecals:CustomNormals(Camera, CameraData) (at Assets\Dynamic Decals\Components\Core\DynamicDecals.cs:901)
    4. DynamicDecals:RenderProjections(Camera) (at Assets\Dynamic Decals\Components\Core\DynamicDecals.cs:851)
    5. UnityEngine.Camera:FireOnPreRender(Camera) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\CameraBindings.gen.cs:719)
    6. UnityEngine.Camera:Render()
    7. FastOcean.FReflection:RenderReflectionFor(Camera, Single, FReflParameters) (at Assets\FastOcean\Scripts\FReflection.cs:204)
    8. FastOcean.FReflection:WaterTileBeingRendered(Camera, Single, Material, FReflParameters) (at Assets\FastOcean\Scripts\FReflection.cs:87)
    9. FastOcean.FOcean:OnWillRender(FOceanGrid, Material) (at Assets\FastOcean\Scripts\FOcean.cs:2293)
    10. FastOcean.FOceanGrid:OnWillRenderObject() (at Assets\FastOcean\Scripts\FOceanGrid.cs:1617)
    11. UnityEngine.Camera:RenderWithShader(Shader, String)
    12. DynamicDecals:CustomNormals(Camera, CameraData) (at Assets\Dynamic Decals\Components\Core\DynamicDecals.cs:901)
    13. DynamicDecals:RenderProjections(Camera) (at Assets\Dynamic Decals\Components\Core\DynamicDecals.cs:851)
    14. UnityEngine.Camera:FireOnPreRender(Camera) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\CameraBindings.gen.cs:719)
    15. UnityEditor.Handles:Internal_DrawCameraWithGrid(Camera, Int32, DrawGridParameters&)
    16. UnityEditor.Handles:DrawCameraImpl(Rect, Camera, DrawCameraMode, Boolean, DrawGridParameters, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorHandlesBindings.gen.cs:902)
    17. UnityEditor.Handles:DrawCameraStep1(Rect, Camera, DrawCameraMode, DrawGridParameters) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorHandlesBindings.gen.cs:922)
    18. UnityEditor.SceneView:DoDrawCamera(Rect, Boolean&) (at C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:1113)
    19. UnityEditor.SceneView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:1541)
    20. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    21. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    22. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    23. UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:262)
    24. UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:255)
    25. UnityEditor.HostView:InvokeOnGUI(Rect) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:222)
    26. UnityEditor.DockArea:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:346)
    27.  
    28. [C:\buildslave\unity\build\Runtime/Camera/Camera.cpp line 1079]
    29. (Filename: Assets/Dynamic Decals/Components/Core/DynamicDecals.cs Line: 901)
    30.  
    Crash!!!

    It comes from here:
    Filename: Assets/Dynamic Decals/Components/Core/DynamicDecals.cs Line: 901

    I do not even use your asset, it is just loaded.
     
  3. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi there,

    Very cool system. Tried every decal solution in the asset store and this is by far the most efficient. Congrats!

    Now a simple question. How can i set a random scale for the ray painter projections? Maybe it is there, but i can't find how. If it is not possible, maybe it would be a cool feature to add some parameters like random scale or such. Just to avoid to acces each projector and do it by code.


    Thanks alot!
     
  4. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Normal doesn't work. I would like to use the shader for terrain trails... Could you check this and fix the issue, if you can confirm this? However, nice work! (Unity 5.5.1f1)
     
  5. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @jimburn - Do you by chance, have another class in your project titled button? A naming conflict could cause the error. Try replacing "Button" with "UnityEngine.UI.Button", should fix the issue.

    I'll be adding a namespace in 2.0 (Finally caved), should prevent issues like this.

    The crash, seems to be caused by something called FastOcean trying to render while I'm performing ShaderReplacement to get Normals. (Believe to be from a depreciated asset (https://www.assetstore.unity3d.com/en/#!/content/47203)). Are you using Ceto(Scrawks Ocean) and does disabling this prevent the crash?

    @Danirey - Currently, you would have to modify the print method and use a custom printer (Similar to how I suggested lazdnet implement color changes on print). I do feel this is a bit of a hack though.

    In 2.0 I'll allow printers to print decals with behaviors attached. And things like fading and culling will be moved out of pooling and into custom components. This means the overhead for these actions are only performed on decals that need them. It also means that in 2.0 you will be able to attach a component to your decal prefab that sets your decals scale randomly during OnEnable, and when your decal is printed this can be called automatically. It's generally just a more flexible, robust and performant method to allow modification of printed decals.

    @mkgame - Normal and Roughness decals will only work in deferred rendering. Forward rendering is not rendered into separate buffers, so we cannot render exclusively into a single buffer (ie. normal or spec/gloss). The best you'll be able to do is render a similar material with your adjusted normal's over the top of your original surface, and use the alpha of your texture to blend it in as well as you can. Or switch to deferred rendering, though I definitely do not suggest switching render paths just to get access to normal decals.

    2.0 is taking a little longer than expected, figure now is the time to experiment, rather than after I've already restructured the entire system. There's a lot to look forward too though. I also think I've discovered a way to render deferred decals without command buffers, which solves a lot of problems, is significantly faster, and will almost eliminate the overhead from culling. Thanks again for all your support and patience.
     
    mkgame, Danirey and Nateply like this.
  6. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    Yes I am using Fast Ocean (not CETO), and this asset is not crashing normally. https://www.assetstore.unity3d.com/en/#!content/70646
    I have no decals on the screen, I just import your asset. Why is your asset running when I am not using any decals on screen?
    Is there a way to perform the shader replacement once or do it in a way that it won't crash Unity?

     
  7. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    The system runs in the background once initialized, any reference to it will initialize, decal, omni-decal, mask etc.
    Once upon a time it ran on an injection based singleton, but it caused far too many issues when entering and exiting edit mode, so I switched to a more generic editor singleton. The system still needs to run if decals aren't on screen though, so it can determine when they are and aren't on screen.

    I've contacted the developer of the asset, I have a few theories as to what's causing the crash, but I really can't confirm anything without his input. Is there an email we could contact you with?
     
  8. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thanks! My game uses deferred rendereing, but I guess not my test project, where I downloaded it...
     
    DanielDickinson likes this.
  9. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    Hey - this looks pretty awesome! I'm thinking about purchasing this to use in my game remake. I do have a question - can decals be saved so that I can save a level and then reload it later? Also, can I choose what objects decals can be painted on?

    I'm thinking about making a paint gun so that players in my game can spraypaint walls to mark where they have been. I'd obviously like those decals to be permanent, but I'd like to avoid certain things being spraypainted
     
    Last edited: Jun 4, 2017
  10. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @zornor90 - Decals can be serialized or saved with your scene. If you want to serialize them at runtime then load them later you'll have to handle that yourself, but they're no different to any other gameObject, so you would handle it like you would serializing anything else.

    The system allows you to mask which objects decals appear on. You can also have the printers that print your decals at runtime only print on certain layers.

    If your printing detailed decals this is the system for you, but if your trying to paint everything in your environment, splatoon style, look at a technique called splatmapping.
     
  11. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    988
    Can you bake projected decals into texture of a skinned mesh at runtime?
     
  12. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @SunnySunshine - No, you would need something like UVPaint to do that. Dynamic Decals is focused on decals that can be generated and manipulated at run-time, not baking decals.
     
  13. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    988
    Thanks for the answer. Didn't know about that other asset. Seems more like what I was looking for. Thanks!
     
    DanielDickinson likes this.
  14. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries

    Hi, I'm using my own scripting and pooling system to place decals and all works fine but because the decals do not have materials how do I get access to the Albedo's alpha to fade them?

    Thanks.
     
  15. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Griffo - You can modify the alpha channel of the decals albedoColor.
    Something along the lines of -

    Code (csharp):
    1. Color modifiedColor = myDecal.AlbedoColor;
    2. modifiedColor.a = newAlphaValue;
    3. myDecal.AlbedoColor = modifiedColor;
     
    Griffo likes this.
  16. Slymp

    Slymp

    Joined:
    Nov 18, 2014
    Posts:
    3
    Hi, I encounter difficulties to use decals on a ground composed of a custom shader and a texture atlas as material.

    I'm not sure to really understand correctly this sentence "The shaders are reliant on the individual local transform matrix of each projection, so they cannot be batched. This means at least a single draw call per Projection." but if I'm not wrong, I should be able to use decals on a texture atlas ?

    http://prntscr.com/fhk3dz -> on the right part, a simple plane with a blue material/standard shader, on the left part my ground with a baked material and a custom shader ( http://prntscr.com/fhk4gu ). I'm not really experimented with graphics programming/shaders but could I add some code to my shader to be able to handle decals ? Thanks
     
  17. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Slymp - As long as your shader writes to the depthbuffer (zwrite on) you should be able to draw on it. Make sure it has a rendertype tag so we know how to draw it in shader-replacement. If your using deferred rendering and your shader only supports forward you'll have to enable force forward rendering (Dynamic Decals Window) so the decals can be drawn after your object.

    If you have any trouble send me a copy of your shader (support@llockhamindustries.com) and I'll set it up for you :)
     
    Slymp likes this.
  18. Slymp

    Slymp

    Joined:
    Nov 18, 2014
    Posts:
    3
    Thank you very much, I tried to enable force forward rendering but it's not enough to make it work. I sent you an mail :)
     
  19. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries Hi, I'm getting strange results, sometime you see them fade and sometimes they don't, but as in the picture it shows in the inspector that they are fading but not in the scene or game view .. Strange?

    Also how do I change the Texture2D of the Decal?
    I thought ..

    myDecal.AlbedoTexture = NewTexture;
    or
    myDecal.UnityEngine.Texture2D = NewTexture;
    or
    myDecal.Texture2D = NewTexture;

    Thanks.

    Screen Shot 2017-06-09 at 11.17.30.png
     
    Last edited: Jun 9, 2017
  20. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Strange indeed, does this occur at run-time, or only while the game is not playing?

    Edit:
    - Does calling myDecal.UpdateMaterialImmeditately() after modifying the decal fix the issue?
    - Are you in Deferred or Forward Rendering?

    Edit Edit:
    Code (csharp):
    1. myDecal.AlbedoMap = myNewTexture;
    Should allow you to modify your albedo texture.
     
    Last edited: Jun 9, 2017
    Griffo likes this.
  21. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi, I'll try you solutions in a bit, but I just tried 'myDecal.AlbedoTexture' and got this error message ..

    'AlbedoTexture' is not a member of 'Decal'. Did you mean 'albedoTex'?

    And if I use 'albedoTex' I get this error message ..

    'Decal.albedoTex' is inaccessible due to its protection level.
     
  22. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Apologies, use AlbedoMap, not AlbedoTexture, edited above :).
     
    Griffo likes this.
  23. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    AlbedoMap worked, and also calling myDecal.UpdateMaterialImmeditately() worked :)

    Thank you ..

    PS I'm using Forward Rendering.
     
  24. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Sweet! Only call updatematerialimmediately once after all your changes are made, no need to update it unnecessarily. It should do automatically, the next frame, I'll look into it..
     
    Griffo likes this.
  25. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I know it is very minor thing, but can we get the warnings off for the 5.6.1p3 (5.6x in general I guess)
     
  26. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @castor76 - That's fair, spending longer than anticipated on 2.0. I've uploaded a new version to the store that fixes the warnings, should be up within a week. Sent a copy to your email as well :).
     
  27. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Does your system support geometry based decals? As used more and more in hard-surface modeling?
     
  28. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Marco-Sperling - No, this is a system for runtime decals, geometry decals is essentially just a single shader. I know there was a thread with a working solution to geometry decals in deferred a few months back, I'll see if I can find it for you..
     
  29. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
  30. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    I am searching for an all-in-one solution regarding deferred decals. So nothing stopping me - just curious and keeping my eyes open. :)
     
    DanielDickinson likes this.
  31. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @marco-Sperline - I know there both techniques are technically titled "decals", but they're not really related. They don't really share any systems, so there would be no real advantage to having them combined in a single system. If I where to release geometry decals (Not currently planned :p) I would honestly probably release it for free as a separate package. I don't really think it suits being jammed it into this system as an additional feature. That's just me though.
     
    Marco-Sperling and Martin_H like this.
  32. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I'm currently building a VR game and using another solution for blood on enemy characters.

    I want to possibly switch to this system. A few questions...

    1. How fast is this asset at projecting blood decals vs altering UV of material of a skinnedMeshRender?
    2. I want dead bodies to linger until the player kills a certain amount...sort of like a pool. Is it possible to keep the decals on the body and have them go back into the pool when the dead body gone? (want to make sure I can identify decals projected on a particular mesh).

    3. Is the speed of projecting on a skinned mesh renderer the same as projecting on a mesh render of complex surface?

    Thanks!
     
    DanielDickinson and donov like this.
  33. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @sbmhome - 1. - That's entirely dependent on the complexity of the mesh being altered, if it's very low resolution, and you only have to alter the uv's of a few vertices, It's definitely possible altering the uv's is faster, while if it's very complex, projecting decals could definitely be faster.

    2. - Pooling is included in the system, but you would have to loop through the children of an object and check if they have decal components attached, returning them to the pool, before deleting an object. You could pretty easily write a method that recursively checks children for these components and run it in OnDisable. Otherwise the pooled decals would be deleted instead of returned to the pool.

    3. - The speed of projection is completely independent of the surface being projected on. It doesn't matter if the surface consists of 10 verts or 10 million verts, or if it's a skinned mesh renderer or not (Calculations are performed per pixel in screen-space (shader magic :p)).

    Currently the system does not support single pass stereo rendering for VR. So if your developing a VR game this is definitely something to be considered.

    If your looking for a solution for blood on just skinned meshes, you may want to consider a UV-space decals system (UV-Paint or the like, never actually tried UV-Paint, check review etc.). If you want a system that will work for you characters and your environment, this system will suit you better, but be a little more finicky for your characters.
     
  34. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Thanks for the reply. I'm currently using UVpaint, but find it may be to expense for my project performance wise. I'll go ahead and try out your system
     
  35. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries Hi, have a strage problem, getting this message ..

    Shader error in 'Decal/Metallic': failed to open source file: 'Cginc/ForwardProjections.cginc' (on metal)

    Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN _Blend _HighPrecision
    Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3

    causing this ..

    Screen Shot 2017-06-28 at 14.58.57.png

    Unity 2017.1.0b10

    Thanks.
     
  36. RemexChris

    RemexChris

    Joined:
    Aug 4, 2015
    Posts:
    16
    @Llockham-Industries Hi, loving your asset but disappointed to see that Single Pass Stereo is not yet supported. I saw you mentioned that you think this is a Unity side issue and other developers have hit similar blocks. I'm keen to understand in a bit more detail exactly what this is? Are Unity aware of the issue / investigating it? Do you have an ETA as to when this may be resolved?
    Keep up the great work!
    Cheers,
    Chris
     
  37. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Griffo - Wait up, have you moved any of the shaders relative to the Cgin directory? or is the cginc directory missing? ie. is the Metallic shader still in the DynamicDecals/Resources folder, and is there a CGinc. folder in that same folder?

    If you haven't touched anything could you try a fresh copy of the system? It's possible something was missed or corrupted during install

    Essentially it's saying it can't find the cginc. it needs to run. This needs to be in a precise location relative to the shader file itself.

    @RemexChris - They are aware, bug report here. It's possible they've fixed it in 2017 and not announced it yet, I'll give it another go in 2017.1.

    Essentially SPS renders both cameras into a single buffer. It still renders each object separately, but instead of going through the entire render-loop twice, you do it once but render each object twice in quick succession, so you only have to change the view and projection matrices between the duplicate objects (Much faster). Currently manually rendering cameras (shader replacement) doesn't change the view and projection matrices when rendering the duplicate object (second eye), so we only get a single eye. The decals themselves render fine, the prerequisite depth & normal information is the issue.
     
    Last edited: Jun 29, 2017
  38. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries Thanks for the reply ..

    Here is my Dir, I did move all to plugins to speed up compile time ..

    Screen Shot 2017-06-29 at 11.05.27.png
     
  39. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Griffo - The Plugins folder is traditionally for pre-compiled .dlls, ie. pre-compiled assets. Dynamic Decals isn't pre-compiled, as I want to encourage people to dive into it, extend it and experiment with it themselves. This might be the issue, could you try moving the asset outside of the plug-ins folder?
     
  40. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries OK will do, but I have it in another project in Plugins and all works fine ..

    Screen Shot 2017-06-29 at 11.51.02.png
     
  41. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries Ummm, just released why it's in plugins because some of my .js need access to theDynamic Decals scripts ..
     
  42. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Tested all the versions I have available (incl. 2017.1.f1), in and outside of the plug-ins folder (And yeah, valid point, was worth a shot) and I cannot recreate the issue. I'll grab your exact version of the beta now, in-case it's a beta issue. If you haven't already, could you grab a fresh copy off the store? backup any changes you've made to the system, if any.
     
  43. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Llockham-Industries I dragged the Shaders folder out of Plugins/Dynamic Decals/Resources and into the asset folder, restarted Unity, dragged it back into the Plugins/Dynamic Decals/Resources folder, restarted Unity, and now it all seems to be working ok, looks like somewhere along the line the link was broken, fingers crossed .. Thanks for the input.

    PS I have the latest version of Dynamic Decals.
     
    DanielDickinson likes this.
  44. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Llockham,

    I just bought Dynamic Decals and just started playing around with it. I'm a little bit confused about using it on Terrains. I'm having trouble getting any decals to show up on a terrain at all. I'm using Unity 2017.1.0f1.

    So far the only way I can get a decal to appear is to make sure it's projection limit is greater than 90 and then it only appears as a square. If I move the decal over a rock that has a capsule collider, the decal appears correctly but quickly loses it's intended shape and turns into a square when it's moved onto the terrain. So far I'm just using some of the decal prefabs in your demos.....Yellow Decal from the rain demo. While on the terrain, messing with Transparency Cutout doesn't appear to do much except adjust the size of the square in a small amount and Blend mode just fades the Square in and out. Other than that I haven't changed the default settings on your Yellow Decal prefab.

    I'm using Forward rendering since my intended targets are mobile.

    Thanks
    Allan
     
  45. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @chaneya - Is there any chance you have the decal pointing in the wrong direction? Decals project in the forward axis (Blue arrow in local space). By default, those decal prefabs are pointing forward, not down, so will be projecting sideways. Try rotating them until they're facing down towards the terrain. If this wasn't the issue let me know asap, testing on my end in 2017.1.0f1 appears fine.
     
  46. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    You are correct! I failed to notice that the instantiated prefabs are rotated at 90 along the X axis. When you just drag them into a scene with rotation zeroed out, you see nothing. Interesting.

    Thanks
    Allan
     
    DanielDickinson likes this.
  47. nickhl

    nickhl

    Joined:
    Jun 19, 2017
    Posts:
    1
    Hi,
    System is looking great. Does it support UWP-Builds?
    Thx
     
  48. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @nickhl - I've not had a chance to test myself, but there's no reason it shouldn't. If you'd like to test for me, send me a private message. I'll send you a code and if you find any issues, I'll work with you to fix them. You get a free copy, system gets testing :).
     
  49. RemexChris

    RemexChris

    Joined:
    Aug 4, 2015
    Posts:
    16
    Hi llockham-Industries, thanks for your explanation- much appreciated! I have upvoted your bug request so let's hope it gets tackled soon.

    Another question for you. I would like to render decals on terrain only. Unfortunately this is a bit of a pain with Projection Masks as I can't assign them to terrains and therefore make my decals only project on them. Instead have to move all my other meshes into layers and not project on this. With complex objects in scene with large nested hierarchies of sub objects with their own meshes this is not practical. Is there any way around this, such that we can tag terrains as
    projection mask layers? (Or alternatively, am I missing something obvious? :))

    Thanks,
    Chris
     
  50. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    Thanks for the up-vote, appreciate it :).

    Unfortunately, as the system currently is there is no good way to mask the terrain, so masking everything else is the best solution if masking is the only solution. I agree with you, this isn't ideal.

    I might be able to reconstruct a copy of the terrain meshes/chunks in editor by sampling the terrains height map, And this could be done and baked in editor so it would be performant at run-time. If it works I could include a separate terrainMask component to mask the terrain itself. I'll let you know how I go.