Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hair Samples #6477

Merged
merged 17 commits into from Dec 16, 2021
Merged

Conversation

AlixMi
Copy link
Contributor

@AlixMi AlixMi commented Dec 3, 2021

image
image
image
image


Purpose of this PR

New Hair scene for samples, showing different set up to render hair.


Testing status


Comments to reviewers

I need to do the Kajiya Kay (our old Hair shader) samples, that's why the materials on the hair strands are black.
Please check out the shadergraph and review them as well

This reverts commit af0da06.
kajiya still missing
# Conflicts:
#	com.unity.render-pipelines.high-definition/Samples~/MaterialSamples/Scenes/Hair.unity
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/jobDefinition/.yamato%2Fall-hdrp.yml%23PR_HDRP_trunk
With changes to HDRP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@johnpars johnpars changed the title Hdrp/samples/hair marschner samples Update Hair Samples Dec 3, 2021
@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 7, 2021

image

Finished Kajiya Kay samples

@AlixMi AlixMi marked this pull request as ready for review December 7, 2021 13:57
@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 7, 2021

The whole samples weight ~11Mb (mesh, texture, shadergraph, materials), removing ~2Mb of the old hair samples, so this will increase hdrp package, will try to further slim file size

Copy link
Contributor

@johnpars johnpars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this!

One remark: can we enable the MSAA frame override for the game view camera? It will greatly reduce the aliasing for the strands. It would be even better to do it for the scene view too, but I am not sure if that is doable for samples.

@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 8, 2021

The problem with MSAA is that we have to set up in the project settings, and the material samples have no power over that, it's just content, should I write a note about how to enable MSAA in the scene for better anti aliasing on the hair strands ?

Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing status: Done
Very nice sample, visually pleasing and easy to use. Good default values, can quickly create hair variant of your own. Found a few minor issues

Whats tested

  • Went over all files to check they are all used
  • Took a look at all hair examples
  • Tried to create hair of my own for each shader type (3 hair models), to verify every parameter works and its easy to use.
  • Testing was performed on mac

Issues:
1) New warning
Just started testing. So far noticed a new warning "A meta data file (.meta) exists but its folder 'Packages/com.unity.render-pipelines.high-definition/Samples' can't be found"

Suggestion: Dont include file: "com.unity.render-pipelines.high-definition/Samples.meta" in the commit

2) Shaderpath (optional). We have a dedicated section for HDRP sample shadergraphs, but the hair ones are instead using generic location Shader Graphs

Screenshot 2021-12-08 at 15 36 33

Suggestion: Edit this bit to move the shadergraphs to HDRPSamples

Screenshot 2021-12-08 at 15 40 02

3) Hair naming inconsistencies. Most of the properties are using underscore naming An_Example, but two properties use camel case AnExample.

Screenshot 2021-12-08 at 15 45 10

Suggestion: Simply use spaces if there is no reason not to. Or if there is an issue, then use camel case or underscores for everything

4) Empty notes

Screenshot 2021-12-09 at 12 14 43

5) Text Its mostly okay, but needs a pass from doc team

@iM0ve iM0ve requested a review from Vic-Cooper December 8, 2021 14:32
@SeanPuller
Copy link
Contributor

image
these settings might be better for the camera movement in the small environment

Added Subgraph, correct property naming, text, added the ability to set hair direction for all cases
@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 10, 2021

image
Added keywords for vertex color for Ribbon Shader, this will show more how the samples models are made and what kind of data users will need to replicate to make it works on others models. Setting the keywords OFF will allow user to have models without any baked info, the shader will work fine, just with less feature.

@Vic-Cooper
Copy link
Contributor

Vic-Cooper commented Dec 13, 2021

I have the following suggestions to re-write the anotations in the attached images:

A Physical hair shader that uses per-strand geometry.

This example uses an opaque Material with no Textures. Instead, it uses vertex color for ambient occlusion, strand index, and radius. Each strand is a screen-aligned ribbon.

For more details, see the PhysicalHair_Ribbon shadergraph.


A Physical hair shader that uses transparent card geometry.

This example uses the before refraction and alpha clip nodes. It writes to the motion vector to avoid jitters caused by Temporal anti-aliasing (TAA). It also uses transparent depth prepass with a threshold.

For more details, see the PhysicalHair_Cards shadergraph.


An Approximate Hair Shader that uses transparent card geometry.

The Approximate model is based on the Kajiya-Kay algorithm. To use this model you have to manually balance the different components of the render, for example, basecolor, specular, and smoothness.

For more details, see the ApproximateHair_Cards shadergraph.

Copy link
Contributor

@Vic-Cooper Vic-Cooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added suggested changes to the images as a comment.

Screen Aligned Thickness and Depth Offset
Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All issues are fix from my side, can be merged when the documentation feedback is implemented

@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 14, 2021

image
Update on the text @Vic-Cooper and @iM0ve is this alright for you

@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 15, 2021

maybe a solution for sticky notes : edit text directly inside the shadergraph text file

@AlixMi
Copy link
Contributor Author

AlixMi commented Dec 16, 2021

Found a workaround thanks to @SeanPuller by editing directly the shadergraph text file to make the sticky notes saved, just added some more precisions
image

image
image

@sebastienlagarde sebastienlagarde merged commit 6a5da25 into master Dec 16, 2021
@sebastienlagarde sebastienlagarde deleted the HDRP/Samples/hair_Marschner_samples branch December 16, 2021 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants