naelstrof / SkinnedMeshDecals

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

Could you do URP compatible? #3

Closed futer24 closed 3 years ago

naelstrof commented 3 years ago

It actually already is! Though only for 7.3.1 atm. If you have amplify shader editor you should be able to simply recompile the shaders within the urp package if you want it to work with urp 10+. Alternatively you can write your own!

naelstrof commented 3 years ago

I'm heading to sleep now, but tomorrow I should be free to help over discord if you need it. Feel free to add me at naelstrof#7705

futer24 commented 3 years ago

Oh, Yes I saw the URPshaders unitypackage.But I not using the payed asset Amplify Shader. So I can't control any typical shader parameters like it could change in an URP Lit, like smoothness or metallic map values

naelstrof commented 3 years ago

No worries! As of https://github.com/naelstrof/SkinnedMeshDecals/commit/f783e873ab92f214ca45539a06f69af2b2d39d98, I included a quick ShaderGraph example of a shader, the system will support any shader that takes a _DecalColorMap texture! So as long as you're able to create shaders, you can have it do whatever you'd like.

Here's the shadergraph example attached just in case: ShaderGraphExample.zip

Let me know if you have any trouble!

futer24 commented 3 years ago

No worries! As of f783e87, I included a quick ShaderGraph example of a shader, the system will support any shader that takes a _DecalColorMap texture! So as long as you're able to create shaders, you can have it do whatever you'd like.

Here's the shadergraph example attached just in case: ShaderGraphExample.zip

Let me know if you have any trouble!

Hello

There is errors in the shader:

Exception thrown while invoking [OnOpenAssetAttribute] method 'UnityEditor.ShaderGraph.ShaderGraphImporterEditor:OnOpenAsset (int,int)' : ArgumentException: JSON parse error: The document root must not follow by other values. UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at <5070e0347dee4c9faba7201166fbed9d>:0) UnityEngine.JsonUtility.FromJson[T] (System.String json) (at <5070e0347dee4c9faba7201166fbed9d>:0) UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.Initialize (System.String assetGuid) (at Library/PackageCache/com.unity.shadergraph@7.5.3/Editor/Drawing/MaterialGraphEditWindow.cs:697) UnityEditor.ShaderGraph.ShaderGraphImporterEditor.ShowGraphEditWindow (System.String path) (at Library/PackageCache/com.unity.shadergraph@7.5.3/Editor/Importers/ShaderGraphImporterEditor.cs:50) UnityEditor.ShaderGraph.ShaderGraphImporterEditor.OnOpenAsset (System.Int32 instanceID, System.Int32 line) (at Library/PackageCache/com.unity.shadergraph@7.5.3/Editor/Importers/ShaderGraphImporterEditor.cs:59) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

The anothers URP's shader updated in the Github also not working

Using: Unity 2019.4.20f1 Shader Graph 7.5.3

Thanks

naelstrof commented 3 years ago

I've added a few other URP examples, without using ShaderGraph. Hopefully that helps. All you really need to do is have a shader that references a texture-- no matter how you manage to make it, it should work on whatever pipeline.