Search Unity

Question Any recommendations on applying "burn" marks to nearby static geometry?

Discussion in 'High Definition Render Pipeline' started by dgoyette, Dec 17, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I have an effect in my game where an explosion will go off, and I'll look in the 6 axis directions for a solid object (raycasting), and put a "burn" decal there if I hit something. Here's an example of this looking "okay", where the red circle shows where the bomb went off:

    upload_2020-12-17_18-58-24.png

    However, since I'm using HDRP decals, which don't yet support an angle limit, this approach looks bad when that decal intercepts other geometry. Here's an example where a bomb went off behind that green panel, in a small hallway there. Those thick lines you see are the decals that are normal to the hallway, but which intersect the wall we're facing:

    upload_2020-12-17_18-55-46.png

    (The lines are extra fat here just to make sure it's clear. But simply making the decal "thinner" just creates other noticeably thin lines, and makes the decal less versatile when it comes to uneven geometry.)

    So, this looks terrible. I'm curious if anyone could recommend a possible different approach to applying burn marks to nearby static geometry, so that I get more or less the effect from the first image, without the downsides of the second.

    One approach I've considered is dynamically cropping the decal by somehow detecting that it will intersect some other object. But in this case, the places where this looks bad are other faces of the same object.

    Anyway, any other ideas on if there's some clever way to position by decals to avoid this kind of issue?