Spray Paint

Hello, I’m working on a Spray Paint blueprint and was wondering, how should I handle spraying the paint on walls? I know I could use a Deferred Decal but would that be performance intensive if the player sprays it everywhere? Thanks! :slight_smile:

I would like to know the answer to this one too.

Hi

I did this through LineTrace and put a decal on the wall.

1 issues known by UE4, for some reason they can disappear for no reason.

But surprising enough, I had 250 decals put on walls with only a very minor a dip in FPS, and that was my old computer.

It is not that graphics intensive.

It sounds very nice, however, if you want a constant line which is not separated to dots, and want the player to be able to spray on objects with no limit ( ok, with a sane one… ) this number of decals is not enough…

Hi

ULLS answered me, with an array they seem to stay.

I can think of two possible solutions in addition to decals. But whether or not these are viable for you depends on your game ant what you’re actually trying to achieve.

If the player is only allowed to spray on certain areas, like a whiteboard, you could look into using render textures. I’m not sure how well these are supported in blueprints, you might have to use some C++ for this. Basically you would have a (render) texture that you manually draw your spraying into. You could connect the hit results of your line traces with lines, to avoid the dotted appearance. One limitation of this approach is that you would have to have a separate render texture for each of your sprayable surfaces. Depending on the number of these areas, the memory requirements could be too big.

Alternatively, if your game is more about covering in paint and less about actually drawing things, you could prepare some blendable materials and display the correct ones when the player starts spraying an . Kind of like how most car games have prepared partial damage models and then apply the correct damage depending on where you hit your car. When enough areas are covered, you simply fade to a fully sprayed material.

It would be really interesting if we could paint in the ‘alpha’ channel of a material to change the appearance of a layered material.

1 Like

I can’t remember where it was but somebody posted up a nice example with blueprints of a whiteboard that you could draw on with a marker, see if you can find that. It seemed to work pretty well.

Here is a full in-game graffiti maker to anyone interested: Graffiti Maker in Blueprints - UE Marketplace