9 hours ago, 3ddominator said:Hi
I was looking for something like this for a while now and magically found your post here today!
So i wanted to ask is it possible to implement something like this in Unreal Engine 4? There is a whole thread on their forum and people are bumping it night and day without any answers from epic and everyone (including me) will be psyched if someone can do something about it. This is their forum thread about this feature request:
https://forums.unrealengine.com/unreal-engine/feedback-for-epic/108081-spline-decals
UE4 got both differed and forward and you can choose which one you like but it would be great if it can be used with differed as you already mentioned.
Having no background in the rendering pipeline for Unreal, I cant comment. But the technique you might be able to adapt.
Basically, you need to render your decals into a separate rendertarget, using the Z from the target scene (im assuming you are using deferred here) to do rough z testing. Basically, severe bias on the decal Z test (to avoid any Z fighting). What you really are trying to do is exclude decals that are genuinely obscured by geometry. This pass is all about approximation. when rendering the decals you can add extra stuff like masks etc, baking more information into the rendertarget as you like.
What this then gives you is a view of all visible decals in the scene. Now, on the final render pass, you need to sample from this rendertarget (shader resource of course), blending in the decal onto the terrain. What this does is, Z fighting is completely avoided at any distance.
Let me know if this helps. I've made a few posts on this, including a step by step process I went through to get to my result. You will need to trawl through late to mid 2016 to find it. I couldnt.
This one was also where I posted