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

Making Hair Tip Thinner and Questions About Strand Renderer #42

Open
CakemonBot opened this issue Jan 10, 2023 · 3 comments
Open

Making Hair Tip Thinner and Questions About Strand Renderer #42

CakemonBot opened this issue Jan 10, 2023 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@CakemonBot
Copy link

Is it possible to change the hair size, and make the root thicker and tips thinner?
I guess it could be something to do with strand renderer - built in strip, but using this setting I cannot use custom material, nothing will be rendered in the scene.

My work flow:
Set up a hair instance object> set strand renderer to built in strip, scale up strand diameter and hair can be seen rendered, but in same length
Setup a shader like so
image
Apply it to the hair and the hair works weirdly
image

And if it required some shader knowledge it will be great if a sample shader can be provided, it's a bit advanced for me :)

@fuglsang fuglsang added enhancement New feature or request question Further information is requested labels Jan 13, 2023
@fuglsang
Copy link
Collaborator

Thanks for the workflow description. :)

Being able to visually modify the width of the rendered strands via ShaderGraph is a feature in progress.

@makeplayhappy
Copy link

I'd really like to look into solving this issue, are there any docs on how the strips are generated and the flow of the HLSL files?

@makeplayhappy
Copy link

This worked for my use case
https://github.com/Unity-Technologies/com.unity.demoteam.hair/blob/master/Runtime/HairVertex.hlsl#L160

#if HAIR_VERTEX_ID_STRIPS
	float3 vertexOffsetWS = vertexTangentWS * (_GroupMaxParticleDiameter * (vertexUV.x - 0.5)) * (1 - vertexUV.y * 0.9);
#else
	float3 vertexOffsetWS = float3(0.0, 0.0, 0.0);
#endif
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants