64bbc700fa
- This rendering technique reduces the memory required per pipeline by 750MB compared to the PPLL technique!! - Using 3 screen buffers representing the closest 3 hair gragments depths. - Going through second geometry pass that disqualify any fragment further than the third depth, the technique blends the three closes shaders hair fragments. - Supports the Marschner lighting model (big change from the original TressFX 4.1 implementation) - The current technique is almost twice the performance of the PPLL but not quite as advacned when come to final visual quality. Remarks: Unlike the PPLL, this technique is still lacking some of the advanced features added to the PPLL such as 1. Back lobe (TT) conseal by depth comparison 2. Thickness dependency in light transfer (mainly TT) 3. Allowing TT transfer for thin separated hair strands (might be supported by default with no distinction) Signed-off-by: Adi-Amazon <Adi Bar-Lev 82479970+Adi-Amazon@users.noreply.github.com> Signed-off-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com> Signed-off-by: Adi-Amazon <Adi Bar-Lev 82479970+Adi-Amazon@users.noreply.github.com> Signed-off-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com> Co-authored-by: Adi-Amazon <Adi Bar-Lev 82479970+Adi-Amazon@users.noreply.github.com>
102 lines
3.9 KiB
Plaintext
102 lines
3.9 KiB
Plaintext
{
|
|
"Type": "JsonSerialization",
|
|
"Version": 1,
|
|
"ClassName": "PassAsset",
|
|
"ClassData": {
|
|
"PassTemplate": {
|
|
"Name": "HairShortCutGeometryDepthAlphaPassTemplate",
|
|
"PassClass": "HairShortCutGeometryDepthAlphaPass",
|
|
"Slots": [
|
|
{
|
|
"Name": "SkinnedHairSharedBuffer",
|
|
"ShaderInputName": "m_skinnedHairSharedBuffer",
|
|
"SlotType": "Input",
|
|
"ScopeAttachmentUsage": "Shader"
|
|
},
|
|
{ // DepthStencil for early disqualifying the pixel based on depth. No write.
|
|
"Name": "Depth",
|
|
"SlotType": "Input",
|
|
"ScopeAttachmentUsage": "DepthStencil"
|
|
},
|
|
{
|
|
// the regular render target is blended using inverse alpha to reduce the
|
|
// incoming color contribution based on the hair thickness and alpha.
|
|
"Name": "InverseAlphaRTOutput",
|
|
"SlotType": "Output",
|
|
"ScopeAttachmentUsage": "RenderTarget",
|
|
"LoadStoreAction": {
|
|
"LoadAction": "Clear",
|
|
"ClearValue": {
|
|
"Value": [ 1.0, 1.0, 1.0, 1.0 ]
|
|
},
|
|
"StoreAction": "Store"
|
|
}
|
|
},
|
|
{
|
|
"Name": "HairDepthsTextureArray",
|
|
"SlotType": "Output",
|
|
"ScopeAttachmentUsage": "Shader",
|
|
"ShaderInputName": "m_RWFragmentDepthsTexture",
|
|
"LoadStoreAction": {
|
|
"LoadAction": "Clear",
|
|
"ClearValue": { // reverse depth order: closer --> 1.0
|
|
"Value": [ 0.0, 0.0, 0.0, 0.0 ]
|
|
},
|
|
"StoreAction": "Store"
|
|
}
|
|
}
|
|
],
|
|
"ImageAttachments": [
|
|
{
|
|
// This buffer is used as the render target and should be at non-MSAA screen resolution
|
|
// to make sure no overwork is done.
|
|
"Name": "InverseAlphaRTOutput",
|
|
"SizeSource": {
|
|
"Source": {
|
|
"Pass": "Parent",
|
|
"Attachment": "DepthLinear"
|
|
}
|
|
},
|
|
"ImageDescriptor": {
|
|
"Format": "R32_FLOAT",
|
|
"SharedQueueMask": "Graphics",
|
|
"BindFlags": [
|
|
"Color",
|
|
"ShaderRead"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"Name": "HairDepthsTextureArray",
|
|
"SizeSource": {
|
|
"Source": {
|
|
"Pass": "Parent",
|
|
"Attachment": "DepthLinear"
|
|
}
|
|
},
|
|
"ImageDescriptor": {
|
|
"Format": "R32_UINT",
|
|
"ArraySize": "3",
|
|
"SharedQueueMask": "Graphics",
|
|
"BindFlags": [
|
|
"ShaderReadWrite",
|
|
"ShaderWrite",
|
|
"ShaderRead"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"PassData": {
|
|
"$type": "RasterPassData",
|
|
"DrawListTag": "HairGeometryDepthAlphaDrawList",
|
|
"PipelineViewTag": "MainCamera",
|
|
"PassSrgShaderAsset": {
|
|
// Looking for it in the Shaders directory relative to the Assets directory
|
|
"FilePath": "Shaders/HairShortCutGeometryDepthAlpha.shader"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|