Can you make HDRP decals blend with each other?

So sorry for making two threads at once but I’m keeping them separate as these are two different questions. I’m experimenting a ton with HDRP materials generally and I’ve been fascinated by decals, they blend perfectly with the terrain but is it possible to make them blend with each other?

Okay, I’m going to write up a better post because it was my first time experimenting with decals and I’ve almost got the hang of it. What I’ve done is I’ve used decal materials on a generated mesh and they’re almost giving me the exact effect that I’m looking for.

The problem is whatever it’s doing with the way it renders is it’s getting rid of the circles that have been generated. I’d like the decals to render all at once but I want the decals to not overlap with each other. Would I need to implement a custom stencil buffer to make this work? Or is there a different method I can try with the new HDRP materials?

I want both decal materials to render at the same time if possible.

Having the two circles at the bottom of the map cancel each other out when they overlap and only when they overlap is my goal and it looks like it’s almost achievable with decals. I’m so close to the solution for this problem that I’ve been researching for years it’s been driving me mad lol.

I should point out, that when I use the standard HDRP/Lit I can get almost exactly what I want but because it’s just a regular material I can’t stop the overlap. I don’t know if there are any built in options for that or I have to use some kind of custom shader to get the behaviour to work right.

Bumping because I would really like some ideas on this if possible.

You maybe able to in the shader or on the game object with a mask layer or z-depth test.

The answer to the question asked in the first post is, yes. Decals can blend together.

But the problem is what decals do by default is blend together.

What you’re looking to do is exclude them from each other which is a fundamentally different thing. The answer to that is (mostly) no.

The answer is the same as last time you asked about overlapping range rings. You need to handle the overlap yourself manually in some fashion, either by calculating the outer edge when generating the mesh (as per the end of the previous conversation). Or by rendering your ranges to a separate render texture using a max blend op and using the resulting render texture to drive the decal.

You could plausibly have a decal that only renders to a stencil with a slightly smaller range to mask the inner part of the ring, then render the range rings again, but this isn’t something the existing HDRP Decals support that I’m aware of.

One way to approach this issue might be to use a custom post-processing effect, I’ve been tinkering with similar things in the past. With a post processing effect you could have extra controls like fading away the effects in distance, combining textures that use different/varying UVv and so on. I did a quick test (adapted this from something else I’ve been working on) which basically uses signed distance field type approach and reconstructed world position. The idea was that I would feed in the the positions to the shader, and then merge generated SDF shapes together. Then I just derive a visual boundary from that distance field and add it to the image.