cc_unity_tools_HDRP icon indicating copy to clipboard operation
cc_unity_tools_HDRP copied to clipboard

"Bake custom shaders" not working

Open wilg opened this issue 2 years ago • 9 comments

Baking seems to always use the default unity shaders, even though the documentation says that "bake custom shaders" will use the custom shaders. The unbaked prefab has the correct shaders.

wilg avatar Feb 01 '23 22:02 wilg

It's meant to. It will use the custom shaders for the bits that the default shaders cant replicate, with for HDRP is:

Eye shader - Eye depth and parallax Hair Shader - Vertex colour blending. Eye Occlusion/Tearline - Has vertex displacements.

Everything else bakes down to the default shaders. (Which should make for faster rendering materials.)

soupday avatar Feb 01 '23 22:02 soupday

I see. I do notice some artifacts with the hair though:

Unbaked:

image

Baked:

image

wilg avatar Feb 01 '23 22:02 wilg

Ah yes, I've got to be honest here: I cocked up some of the code in the baking and it gets the two pass hair wrong when baking.

It's fixed in the current Dev version: HDRP10 - https://github.com/soupday/cc_unity_tools_HDRP/tree/dev HDRP12 - https://github.com/soupday/cc_unity_tools_HDRP/tree/HDRP12

soupday avatar Feb 01 '23 22:02 soupday

Oh cool. Do you know what is up with the aliasing in the unbaked image?

wilg avatar Feb 01 '23 22:02 wilg

Is it set to two pass or single pass?

Also you may want to to turn the HDRP shadow filtering to medium. It's usually set to high and it applies that horrible dithering pattern to all the shadows.

soupday avatar Feb 01 '23 22:02 soupday

Two-pass. Perhaps I need to try with your updated version?

wilg avatar Feb 01 '23 22:02 wilg

And yes, I'm still totally struggling with HDRP shadows. I'll try adjusting the filtering settings.

wilg avatar Feb 01 '23 22:02 wilg

New version from HDRP12 branch + rebake model. Fixes the clipping/depth issues. Also changed the shadow filtering to medium which does look better (what?!). It's still very aliased compared to the previous (broken) baked hair above. Is that normal?

image

wilg avatar Feb 01 '23 22:02 wilg

Try looking at the shadows settings on the lights objects themselves. They're usually set to quite low resolution.

Then you've got the shadow settings in the global/lighting volumes, including the Contact shadow overrides, Ambient Occlusion overrides. There's hundreds of shadow settings scattered all over.

If you look at the global volume and the lights in the preview scene, it might give you some idea.

soupday avatar Feb 01 '23 23:02 soupday