Download

Bloodstains ¿Decals, plane?

Hi guys!

I’ve been researching how to put bloodstains in the environment and I don’t know which is the proper way.

Using decals is not fine, because do not work properly, or at least not as we think it should work.

As you can see in the image above, decals are not showing properly without a strong lighting and this is a mandatory thing because is at night in that level. With light they are not visible, and with lights they are showing partially. However, they are not seem bloodstains.

With planes, they will show just like we need, but only works in open and flat spaces. Using decals, they will project on the shapes of the level but they will not show fine.

So, Which is the better/proper way to make bloodstains or bloodsplats?

Regards,

Aidan Puche

A transparent decal would be the way to do it IMO, doesn’t have to be lit either. You can just fake a reflection in the decal material using a reflection vector node to drive a grayscale textures’ UV coordinates.

If you want them to show up more, just multiply their brightness in the material or make them Emissive. if you’re going for realistic rendering however, don’t forget that blood doesn’t glow in the dark and is in fact quite dark itself. I would use a a Multiplying blend mode to apply it, though I can’t remember what Decal type that actually is…

There are multiple deferred decal shader models one of which work in dark areas. I have tried it and it works but as soon as I open the project with the ini change all shaders are being recompiled and the entire scene looks different (there’s less roughness everywhere) making the solution basically useless.

About 4 months ago an Unreal Dev said they would ‘fix decals’ soon but I don’t think there has been any progress, at least nothing visible. I saw something on trello about improving decals but it does not explains if they want to propose a solution to this problem or what improving decals actually means.

Has anyone some insight on it?

We have implemented a Decal System which will solve this very issue, the DBuffer decal feature. Other implementations would be possible but they have problems we would to avoid (break physical based lighting). Documentation is coming but this is the short version:

New Experimental Feature: DBuffer Deferred Decals •Deferred decals now work with baked/lightmass lighting. That has a cost - not all projects make use of baked lighting or need proper decals so this can be enabled as a project setting and you need to change the decal blend mode.

How to activate the feature: • To try DBuffer locally, put this into BaseEngine.ini under [SystemSettings]

r.EarlyZPassMovable=1

r.EarlyZPass=2

r.DBuffer=1

Use new DBuffer decal blend mode

Thanks Eric, I’m going to try that. Hope it goes well with my performance/optimization setup.

Regards,

Aidan Puche.

I know this is a rather old thread however seems to get good looking blood via deferred decal even with the latest build using DBuffer in the properties I always have to add those 3 lines of code or my blood decals just look well very off even with “Dbuffer” decal. Maybe sticky this for people or possibly add those three lines to the baseengine.ini with a new update? Reason I ask is with every update or hotfix I am having to go and add those lines of code again cause the launcher notices you changed stuff and reverts it and while for someone like myself or other people who have been using UE4 since it was released or were beta testers messing with .ini files is really nothing new just irritating but for people who are just starting to use it or hobbyist who might not even know what a .ini file is or how to safely change it I think it should be added. Not trying to rant but especially with blood decals it’s an eyesore seeing them work, engine updates and then they have weird artifacts or pixelation from baked lighting.

FWIW, you can sort of mimic the behavior of a “custom” decal by using a plane with the material function “WorldPositionBehindTranslucency”. by using that you can appear to map your decal onto the ground underneath. The only caveat is that your mesh then needs to be large enough to cover the projected area, so to keep it as small as possible keep it close to the ground.

I do but I also use them on skeletal meshes. I will try that though. The ini fix works wonders and pretty much eliminates the odd baking but I will look in to that as well. Thanks RyanB. Also just wondering is there a similar way to make blood or similar have a wet/fresh look via material editor or is that more dependant on the texture it’s self cause oddly enough finding tutorials for making “wet” or “fresh” blood that doesn’t end up looking like dried paint or metalic nail polish is rather difficult to find unless I am just not looking properly. I love UE4 but liquids compared to UE3/UDK are slightly more trickier if that makes since.