2

Is there any way in Unity to make something like decal projector from HDRP in build-in pipeline? Tried Easy Decals but they doesn't work, at least 2019 version.

Tertium
  • 6,049
  • 3
  • 30
  • 51
  • 1
    Check out [Rendering Command Buffers](https://blogs.unity3d.com/2015/02/06/extending-unity-5-rendering-pipeline-command-buffers/) . There is a decal example there. – Pluto Feb 10 '20 at 13:34
  • @Pluto Yes, I saw this, but it's a little bit old, does it work with 2019.3? – Tertium Feb 10 '20 at 17:55
  • 1
    The project is also in [Unity 2019.3 Manual: Graphics Command Buffers](https://docs.unity3d.com/Manual/GraphicsCommandBuffers.html) so it should work just fine. – Pluto Feb 10 '20 at 22:01
  • @Pluto Unfortunately it's kinda proof of concept: in my scene decals even sometimes disappear when I move or rotate camera :( In demmo scene they work ok though. – Tertium Feb 10 '20 at 22:58
  • I just had a quick look at the project and I think the reason your decals disappear is because the command buffer gets added to the camera only if the object that has the script `DeferredDecalRenderer` attached is in camera view (CB is added in `OnWillRenderObject`, i think this is done to capture the editor cameras not juts the game camera). In the demo project the script is attached to that big plane. Just as a test to see if this is the problem put a cube in front of the camera (as a child so it is always in view) and attach the script to it. – Pluto Feb 11 '20 at 00:25
  • Just have added it in a new project and it doesn't work at all. And when I add steamvr player in example project it locked player camera, so it became always rotated by some angle. – Tertium Feb 11 '20 at 00:58
  • I read all its source and done everything the same way, no luck – Tertium Feb 11 '20 at 01:00
  • 1
    Try changing `OnWillRenderObject` to `OnPreRender` and attach `DeferredDecalRenderer` to the camera instead. (this will mean that decals will not show in the editor but hopefully will work in game). And make sure that the camera render path is deferred. – Pluto Feb 11 '20 at 01:08
  • Strangely, it worked. It still looks like a proof of concept (no culling, inconvenience with renderer script) but it works in VR! Never know where are headset glitches or my fails :) – Tertium Feb 12 '20 at 01:53

0 Answers0