Hi,
I'm trying to find a way to render decals of any shape on my terrain.
I already have implemented a deferred decal system but it could only render simple stuff on “quads” ( very close to this https://mtnphil.wordpress.com/2014/05/24/decals-deferred-rendering/ ), while I'd like to take any object and say “you will now be rendered on the terrain”
Basically something like Torque did on their road system but I don't know how they did it : http://docs.garagegames.com/torque-3d/official/content/documentation/World%20Editor/Editors/DecalRoadEditor.html.
So far I was thinking of rendering the objects flagged as “decals” from a top down ortho view to a texture, then apply it onto the terrain, but this would require multiple cascades to have high quality close to the main camera and also be able to render decals that are really far away.
Maybe an oblique unique frustum intersecting the main frustum would do the job but I'm not sure at all and this looks a bit hazardous, with the same issues we usually face when rendering shadow maps, ie pixel jittering when the camera moves.
Any hint or advice will be welcome,
Thanks.