Decals

Hi! I have a problem… I need to implement a system for adding stickers to a car. I see 2 implementation options, but difficulties arise with each one. At first, I was working on the possibility of using render target, but in this case there is no ability to change the position and sort order of the applied stickers after the fact. Another option is to use decals but they are projected onto the elements of the environment. The solution to the latter could be the one proposed in this thread

but I don’t have enough brains to figure out how to combine decals with CustomStencil… Maybe someone can orient me…

It seems there is an inherent problem with decals being that they are projected onto the surface of an actor or landscape or whatnot and unless they are significantly close to the actor in question, they will spill over onto anything else in the projected path that is set to “ReceiveDecals” this isn’t always a deal breaker depending on the implementation, but sometimes it is.
I have managed to be able to orient them correctly on just about any surface orientation dynamically, but the depth is not something I have been able to iron out completely. Especially if my line traces hit an artifact away from the target surface. Close, but not absolutely perfect. Not dynamically anyway. Flat surfaces that can be calculated outside of runtime aren’t too difficult…

With that being said, what exactly are you trying to do? Just spawn a decal on a car hood?

The ability to add different stickers to any part of the car. At the same time, it should be possible to edit them after a while. Decals perfectly fit these requirements

Not sure about the editing the decals, but the example I’m providing here can get you a close approximation of surface orientation. The “CalculateSurfaceOrientation” function is a little confusing and probably needs tweaking, but maybe it can help.

Size, distances and everything is dependent on the decal and how you’re applying it. This may or may not help you and isn’t much in the terms of editing them. I’ll leave that fun part to you lol. This is used with good success on applying decals like bullet holes on the walls or ground or object in world and I’m sure it’ll work with applying them to a vehicle.

You can use a line trace to point at the car anywhere and place the decal…

The spawn decal function I’m using on the server call is “SpawnDecalAtLocation” not pictured here…

It looks great but again the problem with the projection of the decal on the environment will not go away