naelstrof / SkinnedMeshDecals

An example of rendering decals on SkinnedMesh Renderers in Unity.
MIT License
156 stars 24 forks source link

Low resolution decals on URP 2021.3 LTS #18

Open SETENTIAdev opened 7 months ago

SETENTIAdev commented 7 months ago

Hi, first of all, amazing tool!

I followed all steps and for some reason I cannot get it to work as in the example images. All decals have very low resolution, look:

Unity_nW9yafwhsd

I increased Texels and Memory budget but doesn't help. I imported the URP decalableLit.shader and doesn't help either.

I suspect I'm having some shader issues, as the materials look like this:

Unity_P6PnDi3xTF

I'm using URP 2021.3.34f1 LTS. Does this tool depends on Amplify editor?

I did nothing weird, this is a brand new test project. Any light on this would be appreciated, thank you!

naelstrof commented 7 months ago

Projection shaders will always render pink in the preview, as they are raw shaders unassociated with the pipelines.

Increasing texels per meter is the primary way to increase the resolution, it isn't analog though as it will always round to the nearest power of two. It maxes at 4k textures per object. You can verify this by pausing the game and inspecting the textures on objects.

This should reveal ways it could be further increased. UV2 packing becomes important, and so does separating the world into smaller chunks.

It's very difficult to get SkinnedMeshDecals to a similar quality of other decal techniques, as it trades a lot for the ability to be coherent on skinned meshes while staying very performant.

I would recommend using this technology as a mask to reveal a repeating texture underneath. If you're clever you can vary the edges with a high resolution noise too. Then use it in tandem with other decal techniques when quality is a must.

naelstrof commented 7 months ago

Oh and, while amplify is nice. This tech works in shader graph too, and even raw shaders. The only requirement is to read UV2 on a specifically named texture.