Facepunch / sbox-issues

177 stars 12 forks source link

Mesh Decals #6522

Open Jammie3d opened 1 month ago

Jammie3d commented 1 month ago

For?

S&Box

What can't you do?

Because Decals+ are on the way I want to make sure they'll also support the mesh decal workflow, which is currently not possible in sbox.

The basic idea is that instead of projecting a decal in the scene like you would traditionally, you assign a decal material to some floating geometry and the shader blends that decal normal map with whatever is underneath.

How would you like it to work?

It could be a built in shader that allows normal map projection like the Deferred Decal "Material Domain" in Unreal.

The main inputs it would need are normal maps and alpha masks, but it could also allow optional PBR inputs like roughness as well.

What have you tried?

I have tried making a custom mesh decal shader but I could not get the normals to blend as they would in Unreal.

Additional context

Unreal Example image

image

handsomematt commented 1 month ago

There's a lot of different decal methods going around with similar names that do pretty different things.

Mesh Decals in the complete sense that they are in UE4 are impossible to do with a forward renderer

Decals+ we are working on shipping is the equivalent of binned/clustered decals you see in Doom Eternal & Godot.

Geometry Decals

However Doom Eternal has another decals system called geometry decals that is similar to what you describe:

We could potentially implement this down the line, but it's pretty big system, and quite seperate from the binned decals system.


I have tried making a custom mesh decal shader but I could not get the normals to blend as they would in Unreal.

You wouldn't be able to make a shader that does this, as the effect has to be done on the underlying material's shader.