SkinnedMeshDecals icon indicating copy to clipboard operation
SkinnedMeshDecals copied to clipboard

Usage with ProBuilder Meshes

Open Monitor9 opened this issue 2 years ago • 3 comments
trafficstars

Hello, I use SkinnedMeshDecals on simple meshes with MeshFilter and MeshRenderer, as well as on meshes created with ProBuilder. I was able to generate UV2s lightmaps for these meshes, but even with maximum Texel Per Meter, their quality is terribly low. Example: image ProBuilder UV2 creation: image Shader: image Is this due to the fact that the meshes can be very large in size, or did I set something up incorrectly?

Please forgive my poor English, as it is generated by the ChatGpt translation system.

Monitor9 avatar Apr 28 '23 00:04 Monitor9

Yeah this is an unfortunate side effect of the strategy, large meshes can't possibly get enough resolution. You have a couple of options though:

  • Fall back to regular decals (URP screen space decals for example) when the mesh size is large.

  • Use the texture as a "damage mask" rather than raw texture printing. Allowing you to use the _decalcolomap texture as a mask to sample some high-resolution damage from another repeated texture.

  • Break up the level into smaller chunks.

I hope that helps!

naelstrof avatar Apr 28 '23 04:04 naelstrof

Thank you for your response. I'd prefer not to use the first option, as the standard Unity Decal Projectors on the LTS version don't support layer filtering, and don't filter meshes at all (they project onto everything, and I have a lot of moving props in the game, so they'll be affected). test Can you provide more details on the second option? Perhaps an article or video, as I'm not quite sure what you're referring to.

Monitor9 avatar Apr 28 '23 15:04 Monitor9

I don't have articles or videos, but an example of what it might look like: image

In essence you'd project a pure red dot as a decal onto the mesh, then use the red channel of the _DecalColorMap as a mask to reveal damaged parts.

Depending on the kind of damage, you can do different things, Red could be gradual damage that removes skin/muscle until it reveals bones. Green could be water wetness (for bodies of water), and Blue could be muddiness/dirtiness.

Just use them as masks to sample underlying triplanar maps, or cool glowy effects, whatever.

Then you'd have no need for traditional decals, because you'd simply author decals as how hurty/wet/muddy they are.

naelstrof avatar May 02 '23 05:05 naelstrof