HDA materials and Universal Render Pipeline

   2523   3   0
User Avatar
Member
6 posts
Joined: July 2019
Offline
I am using Starter Kit HDA's in my project and materials with Houdini shader settings are in pink (error) in Unity Universal Render Pipeline version. How can I fix the materials? When converting the HDA material to URP material I am losing the colors defined in Houdini.

Unity Version 2019.4.18f1 LTS.
Edited by wrashidd - Feb. 27, 2021 15:57:54

Attachments:
Screen Shot 2-27-2021 at 3.55 PM.png (1.4 MB)

Omne ignotum pro magnefico
User Avatar
Member
9 posts
Joined: Feb. 2018
Offline
Been wondering the same thing, technically Houdini Engine has these hard-coded within HUE_Defines.cs for example:

public const string DEFAULT_STANDARD_SHADER = "SpecularVertexColor";

Note for SideFX:
It would be a usability improvement if instead these defines were in a ScriptableObject asset, with references to the shader assets (or material assets too), that way depending on the project's render pipeline the bare-bones default shader can be swapped easily without changing code. (That is one of the main uses of ScriptableObjects in Unity, users can just wire up references to assets within the project, the references will also hold when creating a unitypackage)


*edit* so the easiest thing is to just swap out the shader files (though the scriptable object is still a cleaner approach but requires refactoring some code), check the next post.
Edited by xra - March 2, 2021 19:09:31
User Avatar
Member
9 posts
Joined: Feb. 2018
Offline
here are 2 ShaderGraph assets for URP (and HDRP if using 10.x) that can replace the 2 default shaders provided with Houdini Engine for Unity.

These were created in 2019.4.17f1 and URP 7.3.1 but they will work for any version after that, Unity/Shader Graph will upgrade them.

In the latest version of SG (10.x) the PBR Master node has been replaced with a Master Stack output, which should auto upgrade, but if not refer to this documentation: https://docs.unity3d.com/Packages/com.unity.shadergraph@10.3/manual/Upgrade-Guide-10-0-x.html

Just delete HoudiniSpecularVertexColor and HoudiniAlphaSpecularVertexColor from Assets\Plugins\HoudiniEngineUnity\Shaders\ then put the 2 shadergraphs in the folder.

The shadergraph files are named differently because the filename is the shader name, and inside the shadergraph window, on the Properties sub window, there is a path string field which is already set to 'Houdini' (so the name ends up being 'Houdini/SpecularVertexColor' which is what the C# code is looking for when it loads the shaders.

These same shaders also work for HDRP when using ShaderGraph 10.x because the Master Stack output is unified and works with any SRP.
Edited by xra - March 2, 2021 18:56:20

Attachments:
AlphaSpecularVertexColor.shadergraph (50.3 KB)
SpecularVertexColor.shadergraph (45.8 KB)

User Avatar
Member
6 posts
Joined: July 2019
Offline
@xra
Thank you so much! Materials are looking properly now in URP thanks to your provided ShaderGraphs!
Omne ignotum pro magnefico
  • Quick Links