English


Profile Picture

Unity Auto Setup

Posted By Victor.Soupday 4 Years Ago
Rated 5 stars based on 12 votes.
1
...
11
12
13
14
15
...
58

Unity Auto Setup

Author
Message
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 569, Visits: 9.0K
Unity Auto-setup Release 0.2.0

Build-in (Unity 3D): https://github.com/soupday/cc3_unity_tools_3D/releases/tag/0.2.0-3d
URP: https://github.com/soupday/cc3_unity_tools_URP/releases/tag/0.2.0-urp
HDRP: https://github.com/soupday/cc3_unity_tools_HDRP/releases/tag/0.2.0-hdrp

(Special version for Unity 2021.2 HDRP: https://github.com/soupday/cc3_unity_tools_HDRP/releases/tag/0.2.0-hdrp12.0.0
 as 2021.2 uses HDRP pipeline version 12.0.0 which has some incompatibilities with the earlier versions, and also seems to be rather buggy at the moment so use 2021.2 HDRP at your own risk.)


Changelog:

version 0.2.0
  • Fix to eye occlusion compute bake shader.
  • Adusted eye shader corner shadow gradient.
  • Teeth, Tongue & Eye micro normals maps correctly set to normal maps.
  • Added two pass hair material system, whereby all hair submeshes are extracted into single meshes and multiple materials can by applied to each hair mesh.
  • 2021.2
    • 2021.2 uses HDRP pipeline 12.0.0, which has some incompatibilities with previous versions:
    • Fix to correctly add diffusion profiles in HDRP 12.0.0.
    • Updates to hair shaders to correctly apply depth pre-pass and post-pass.
  • Built-in Pipeline
    • Added emission to the Built-in high quality and baked shaders.
    • Removed post processing settings from the preview scene, as they caused errors in later versions.
version 0.1.9
  • URP & Built-in Pipelines
    • Added shaders and materials to use the build-in and Universal render pipeline.
  • Code base
    • Bake shaders and materials updated to support Standard shader and URP/Lit shader.
    • Fixes to material setup texture discovery.
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 569, Visits: 9.0K
Some notes about the 2-pass hair material system.

Recreating a multi-pass hair shader In URP brings with it a number of problems, Other than being much more complex than the surface shaders of the built-in pipeline, multi-pass shaders would also break the scripted render pipeline (SRP) batching for those materials as URP only allows for a single pass in it's shaders.

But there is an alternative answer. Instead of trying to render mulitple passes in a single shader, it is possible to assign multiple materials to a single mesh. Each additional material assigned to the mesh renderer will cause the last sub-mesh in the list to be redrawn with that material and shader. Thus creating multi-pass rendering that is fully compliant with the SRP batcher.

The trick is that some hair objects have multiple sub-meshes, which are not necessarily hair materials, so the hair material sub-meshes must be isolated into their own objects and mesh renderers so they can be easily assigned multiple materials.

So that's what the system does, it extracts, if needed, any hair sub-meshes from the character objects so they can be rendered with multiple material passes, and assigned the two pass materials to them. The package for three pipelines can do this, but the built-in pipeline really doesn't need it as the the hair shader already renders in two passes, though it might be useful if you want to assign your own shaders to it.

76% of original size (was 666x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/82531fdc-ec30-4f53-aa0e-9ea0.png

I've added this as an optional button. Also note that it is only possible to change mesh and object data on a prefab variant of the character fbx, so this function operates on the prefabs (found in the Prefabs sub-folder of the character.)

A comparison of the opaque dithered default shader with the two material pass alpha clip + alpha blend method.

76% of original size (was 666x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/cb44d833-122a-4977-8849-16ab.jpg

There is noticeable dithering in the opaque dithered shader, as expected, which is not present in the two pass rendering. Also as the hair is first rendered opaque to the z-buffer, the second alpha blend pass has much smaller performance impact as it does not overdraw the opaque areas.

But what's interesting about this method is that it also works in HDRP. As the two pass rendering does not need to manipulate the alpha channel for a depth pre-pass (the opaque pass effectively is the pre-pass), it means the hair can be rendered much more accurately and in higher quality.

Putting it all together I recreated a Cycles render I did recently to see what kind of quality I could push out of HDRP and I'm quite happy with the result:

76% of original size (was 666x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/302b02b3-d502-42ca-84e2-dd44.jpg
deidrereaystudios
deidrereaystudios
Posted 4 Years Ago
View Quick Profile
Veteran Member

Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 43, Visits: 346
That is so great, Testing a bit with it now (Built in 2020.3 LTS) am a bit confused on the Hair 2 pass and how one needs to set this up. The button click seems to change the mesh etc, but then what? The materials are staying the same with the STANDARD Shader when a new prefab is made. I can see there are 2 shaders (1st Pass and 2nd Pass) that would assume should set up manually? Does that then require creating 2 Materials for hair? Is there a tutorial going over setting this all up as not sure what should do at this point.
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 569, Visits: 9.0K
It doesn't make any difference for the built-in shader as the default hair shader it uses already does 2 passes. Pressing the 2-pass button sets everything up, you don't need to do anything else, it just doesn't look any different in the built-in version. I left it in for completeness or if you wanted to swap your own shaders in. You would notice a big difference in URP and some difference in HDRP as these pipelines only allow for one shader pass per material.

I also forgot to mention the opaque alpha clipped shader for built-in is there as an alternative, but I haven't put in any buttons or options automatically apply it. It's easy enough to swap in by selecting the hair materials and changing the shader to "Reallusion/RL_HairShaderClipped"

(Maybe I should change the 2-pass button in the built-in version to set-up the alpha clipped shader instead? Might make more sense.)
deidrereaystudios
deidrereaystudios
Posted 4 Years Ago
View Quick Profile
Veteran Member

Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)Veteran Member (747 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 43, Visits: 346
Maybe something like that. Been testing all morning with some good results just messing around, but i have received a few errors from unity on the 2Pass button press.
Attachments
Error MEssage.PNG (41 views, 108.00 KB)
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 569, Visits: 9.0K
deidrereaystudios (10/31/2021)
Maybe something like that. Been testing all morning with some good results just messing around, but i have received a few errors from unity on the 2Pass button press.


It's crashing if there are no vertex colors in the hair meshes. That's fairly serious so I'll fix it straight away with a couple of other fixes I've noticed:

Unity Auto-setup Release 0.2.1

Built-in (Unity 3D): https://github.com/soupday/cc3_unity_tools_3D/releases/tag/0.2.1-3d
URP: https://github.com/soupday/cc3_unity_tools_URP/releases/tag/0.2.1-urp
HDRP: https://github.com/soupday/cc3_unity_tools_HDRP/releases/tag/0.2.1-hdrp10

(Special version for Unity 2021.2 HDRP: https://github.com/soupday/cc3_unity_tools_HDRP/releases/tag/0.2.1-hdrp12
 as 2021.2 uses HDRP pipeline version 12.0.0 which has some incompatibilities with the earlier versions, and also seems to be rather buggy at the moment so use 2021.2 HDRP at your own risk.)

Edit: I've upped the version requirements and dependancies for the 2021.2 version, so it can't be accidentally installed on earlier versions.

Changelog:

version 0.2.1
  • Fix to 2-Pass mesh extraction crashing when no vertex colors were present.
  • Fix to Bump maps being incorrectly detected during material setups.
  • Added normal strength calculations to built-in hair shaders.


jerome.dipietro
jerome.dipietro
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)

Group: Forum Members
Last Active: 2 Weeks Ago
Posts: 91, Visits: 1.1K
@Victor.Soupday just started trying out the URP version. Some glitches (avatar didn't get configured after licking 'Anim', but easy to do manually, and the skull cap was visible through my hair after '2 Pass') but won't bother you about it until I've had a chance to try out more character models and can better identify whether this is model specific.

I just wanted to say a huge thank you and ask whether I can buy you a beer or a bowl of soup to say thanks. Do you have a Patreon, or similar?

                                    
Unity Virtual Reality Developer
dassoubarna
dassoubarna
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)

Group: Forum Members
Last Active: 3 Weeks Ago
Posts: 49, Visits: 673
Currently I am using Unity 2019.4LTS for one of my project(HDRP). What version of the Auto Setup is compatible with Unity 2019.4? Please help!
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 569, Visits: 9.0K
My versions start at 2020.3 LTS.

I had to draw the line somewhere, and the shader graphs are not backwards compatible with 2019.

Reallusions original auto-setup supports 2019.4, I think: https://forum.reallusion.com/489608/Open-Source-Auto-Setup-for-Unity
dassoubarna
dassoubarna
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)Distinguished Member (1.6K reputation)

Group: Forum Members
Last Active: 3 Weeks Ago
Posts: 49, Visits: 673
Thanks a lot.

1
...
11
12
13
14
15
...
58



Reading This Topic

0 active, 0 guests, 0 members, 0 anonymous.
No members currently viewing this topic!