Commit Graph

44 Commits

Author SHA1 Message Date
Sebastien Hillaire
76041cfa45 Strata - fix crash to due blend mode with Strata materials.
#jira UE-174789
#rb none
#preflight none
#fyi charles.derousiers

[CL 23813352 by Sebastien Hillaire in ue5-main branch]
2023-01-23 11:29:07 -05:00
Charles deRousiers
ca1a69fa01 Add Fuzz roughness to Strata slab.
If FuzzFoughness is not connected, the Roughness input is used instead. This allows optional independent roughness control.

#rb none
#jira none
#preflight 6389cc910e4613faed1566e2
#fyi sebastien.hillaire

[CL 23370694 by Charles deRousiers in ue5-main branch]
2022-12-02 05:27:10 -05:00
Charles deRousiers
5b21c9a8e4 Change how thickness is setup on Strata material.
* Add a new thickness input on the root node for thin surface
* Add a new thickness input on vertical layer operator, to provide the thickness of the 'layered' material
* Mark Slab thickness input as deprecated, for converting existing asset once this CL is checked in.

#rb sebastien.hillaire
#jira none
#preflight 638903020e4613faedc9e8be

[CL 23358938 by Charles deRousiers in ue5-main branch]
2022-12-01 14:52:03 -05:00
Sebastien Hillaire
d5a10db158 Strata - thin film becomes are helper node.
#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/637de08ccc307d6fa5f9bcba
#fyi charles.derousiers

[CL 23246732 by Sebastien Hillaire in ue5-main branch]
2022-11-23 04:26:19 -05:00
Sebastien Hillaire
cd4aa07281 Strata - added high quality normal according to GBuffer format.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6374f970b6636838280f3278
#fyi charles.derousiers

[CL 23155230 by Sebastien Hillaire in ue5-main branch]
2022-11-16 11:35:48 -05:00
Sebastien Hillaire
f34b2df7d5 Fixed Strata looking bad on some platforms requiring render target format specification (not account for Strata target count, motion blur not specifying the correct index)
#rb none
#preflight https://horde.devtools.epicgames.com/job/63749aff3248425305676b3b
#fyi charles.derousiers, jamie.hayes

[CL 23151575 by Sebastien Hillaire in ue5-main branch]
2022-11-16 03:26:45 -05:00
eric mcdaniel
502749c59a Fix for async compute on platforms with memory boundary restrictions on async compute dispatch indirect arguments
*** This change will incur a full shader invalidation across all platforms ***

Issues:
  - Some platforms require async compute dispatch indirect arguments to not cross specific memory boundaries
    - This places restrictions on the valid sizes for a dispatch indirect argument set.  We were not conforming to these restrictions which could result in GPU crashes on these async passes

Fixes:
  - FRHIDispatchIndirectParameters is padded out to meet per-platform memory boundary restrictions
    - This is driven via new per-platform preprocessor define PLATFORM_DISPATCH_INDIRECT_ARGUMENT_BOUNDARY_SIZE
    - Some platforms require FRHIDispatchIndirectParameters to align with their internal structure hence we cannot universally size to meet all platform's requirements

  - Introduce new FRHIDispatchIndirectParametersNoPadding for uses when we explicitly do not want the padding and otherwise avoid the memory boundary restrictions

  - Revise and expand indirect argument validation code to catch further such issues in the future

  - Update shaders which write to dispatch indirect argument buffers to account for optional per-platform padding
    - New utility function WriteDispatchIndirectArgs introduced to faciliate this
    - platforms which require other than the default nonpadded dispatch indirect arguments must define DISPATCH_INDIRECT_UINT_COUNT and their own WriteDispatchIndirectArgs in their CommonPlatform.ush

  - move creation of DispatchIndirectGraphicsCommandSignature command signature to be per-platform
    - DispatchIndirectGraphicsCommandSignature and DispatchIndirectComputeCommandSignature stride changed to account for additional padding on impacted platforms

Testing:
  - ran Lyra with and without async compute Lumen on impacted platforms as well as Win64
  - ran FN replay on impacted platforms

#rb Krzysztof.Narkowicz, Ben.Woodhouse, Benjamin.Rouveyrol
#jira UE-167950
#preflight 6359563b2e6690262a11bc06

[CL 22862498 by eric mcdaniel in ue5-main branch]
2022-10-31 10:15:11 -04:00
Charles deRousiers
ecf8b88fde Add dedicated 'decal tile' data to Strata (optional), to dispatch decal work only where there are decals on the frame.
This makes the dbuffer pass 0.05ms faster, but the makes the classification slower by 0.1ms. So no win for now, but further optimization are coming. Disabled for now.

#rb none
#jira none
#preflight 632979ec9840225da24fc245
#fyi sebastien.hillaire

[CL 22091302 by Charles deRousiers in ue5-main branch]
2022-09-20 09:05:17 -04:00
Charles deRousiers
c98236981f Strata - 3 MRTs + legacy shading model fast packing option.
* This CL adds dedicated legacy material compaction and writes 3uint through mrt (for simple clear coat/sss wrap/cloth) instead of 4 uint with 2 through UAV ops). This allows faster base pass in particular on slower platform.
* Activating DBuffer make the entire base pass slower with this change list, but this will be addressed with subsequent changes.

Work done by Seb, submitted on his behalf.

#rb charles.derousiers
#jira none
#preflight 631f8804065c4ac9ce61e81d
#fyi sebastien.hillaire

[CL 22002833 by Charles deRousiers in ue5-main branch]
2022-09-14 03:23:07 -04:00
Sebastien Hillaire
e27b68cc9b Strata - moving SSSData at the end of the strata material buffer to reduce UAV count limitation on dx11.
Fixed a bug wehre loadiung fast material would not be done correctly inside the classification pass for the sharedmemeory path.
#rb none
#jira UE-161415
#preflight https://horde.devtools.epicgames.com/job/630909b9987e7155b1af0aec
#fyi charles.derousiers

[CL 21661992 by Sebastien Hillaire in ue5-main branch]
2022-08-29 02:55:17 -04:00
Sebastien Hillaire
f50162be6f Strata - made the ConvertToDecal node force using parameter blending now that it is a requiremeent.
#rb none
#prelfight none
#fyi charles.derousiers
#preflight none

[CL 21423589 by Sebastien Hillaire in ue5-main branch]
2022-08-17 08:43:39 -04:00
Sebastien Hillaire
bd10222f91 Strata - fixed decals and all legacy material conversion to be a lot simpler and consistent with the strata.
We are no longer fighting the Strata tree but just using it now, since Legacyconversion node can only oputput a single BSDF at any time. Conversion to decals parameter blending will now correctly work.

#rb charles.derousiers
#jira UE-160739
#fyi charles.derousiers
#preflight none

[CL 21423524 by Sebastien Hillaire in ue5-main branch]
2022-08-17 08:26:48 -04:00
Charles deRousiers
554fd4e21c Add Strata custom Eye BSDF.
This allows to have 'fast'/single layer path eye which support dual normal & caustic computation. This first version does not have SSS profile support and is missing the alternative iris normal decoding. This will be added in subsequent CLs.

#rb none
#jira none
#preflight 62a8b5541f6754ac09b164ea
#fyi sebastien.hillaire

[CL 20652223 by Charles deRousiers in ue5-main branch]
2022-06-14 13:03:03 -04:00
Sebastien Hillaire
255a2b8a59 Strata - now using force cast of data when sent to backend fucntions to have a behavior close to the root node. (2d TexCoord can be used as Emissive color for instance)
#rb none
#preflight none
#fyi charles.derousiers

[CL 19806375 by Sebastien Hillaire in ue5-main branch]
2022-04-19 07:13:36 -04:00
Charles deRousiers
9d440f6a81 Remove STRATA_DATA_TILE_XXX to avoid confusion with STRATA_TILE.
#rb none
#jira none
#preflight 6245dbf39f404234145fc039

[CL 19574692 by Charles deRousiers in ue5-main branch]
2022-03-31 13:05:44 -04:00
Sebastien Hillaire
4100e391ab Strata more defines clean up
#rb none
#preflight none
#fyi charles.derousiers

[CL 19539341 by Sebastien Hillaire in ue5-main branch]
2022-03-29 02:29:00 -04:00
Sebastien Hillaire
811ac749a9 Strata - refactor and clean up of FStrataMaterialCompilationInfo into the strata tree.
#rb none
#preflight https://horde.devtools.epicgames.com/job/62421016b6084b98321ad00e
#fyi charles.derousiers

[CL 19538779 by Sebastien Hillaire in ue5-main branch]
2022-03-29 01:49:06 -04:00
Charles deRousiers
b993ce8650 Add BSDF tile and BSDF offset computation.
For pixel with complex/multi-BSDF computes BSDF material byte/index offsets and 'overflowing' tile.

This wil be used by Lumen for handling/parallelizing lighting computation.

#rb none
#jira none
#preflight 6234c38848746817f13c87bb
#fyi sebastien.hillaire

[CL 19438082 by Charles deRousiers in ue5-main branch]
2022-03-18 13:43:33 -04:00
Sebastien Hillaire
781eddedd8 Strata - fixed legacy material issues with opaque rough refractions.
#rb none
#preflight none

[CL 19419681 by Sebastien Hillaire in ue5-main branch]
2022-03-17 08:56:51 -04:00
Sebastien Hillaire
13414c64e6 Strata opaque rough refraction with place holder blur process.
Tiles with SSS but no rough refraction are also added onto the scene color buffer separately from the blur process.

#rb none
#preflight
#fyi charles.derousiers

[CL 19404162 by Sebastien Hillaire in ue5-main branch]
2022-03-16 05:45:43 -04:00
Sebastien Hillaire
1ffe7c958d Strata - Refactored indirect dispatches to source from the same indierect draw buffer, thus avoiding hitting out of uav slots on dx11.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6230946ce65a7e65d6855346
#fyi charles.derousiers

[CL 19384753 by Sebastien Hillaire in ue5-main branch]
2022-03-15 09:55:16 -04:00
Charles deRousiers
9090280376 Change thin layer to act as an Strata operator.
This simplify Strata Slab UI, and make it easier to thin-film coat many BSDFs at the same time.

#rb none
#jira none
#preflight 622fa337c51b66df4c248174
#fyi sebastien.hillaire

[CL 19378172 by Charles deRousiers in ue5-main branch]
2022-03-14 16:46:59 -04:00
Sebastien Hillaire
b8821a1964 Big Strata core update!
- Completely changed the way we evaluate and represent the material topology.
- A topology is now represented as a tree to allow any horizontal/vertical operations (almost like a kdtree).
- This allows for correct translucent material coverage/transmittance evaluation, as well as correct BSDFs luminance weight (finally).
- All the operations to be able to do that are expended in HLSLTranslator instead of letting the compiler handle it (otherwise was too slow, leading to bugs and could not even debug shaders). This means no conditional BSDF packing.
- There is no more Material/layer/BSDFs array: only a Tree or operators, some of them being BSDF at leaves.
- Parameter blending has also been updated: when enabled on a node, it will be forced on all the oprator child / in the sub tree.
- Parameter blending is applied on an inlinedbsdf on the StrataData. When it is the root of the parameter blending subtree, it is promoted to a fully fledged BSDF operator node to allow other regular operators.
- The inlinedbsdf is not longer in premultiplied mode. Horizontal/Vertical/Add parameter blending operators have been updated to reflect that. This allows for simpler/unified/clearer code.
- Vertical blending now uses the new simple "layering of two slabs with uncorelated coverage" math I have RnD'd. See GetVerticalLayeringInfo in ShadingCommon.ush.

Follow up to this CL:
- CompileStrataBlendFunction should use parameter blending.
- Add more compilation debug output
- Update material vizualisation
- Fix Rough refraction
- Fix decals
- Fix debug probes
- Pack FStrataBSDF
- Move all StrataCompilationInfoCreateSingleBSDFMaterial into into the strata tree and rework cost evaluation and material LOD
- Expand graph visit such as UpdateBSDFWeightAfterOperatorVisit to be specific to operators for the compiler to have to do less search to inline what we know already
- Fix STRATA_TODO: operation using parameter blending are not actually discarded so they still occupy a pot in the opeartion arrays in the compiler and in the shader also.

#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/620a5f5d803d9066e67de938
#fyi charles.derousiers

[CL 18993400 by Sebastien Hillaire in ue5-main branch]
2022-02-15 03:09:30 -05:00
sebastien hillaire
9d09d19e34 Strata leverage UAV slice start/count to remove the post base pass copy step.
Ran Strata and non Strata code path.
QAGame cooked on Swi.
ShoorterGame cooked and ran on PC.
#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/61d47489db0309127dfae2a2

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18509133 in //UE5/Release-5.0/... via CL 18509155
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18509183 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-04 12:18:49 -05:00
sebastien hillaire
956da1713d Fix for a pltform to compile when strata is off.
We always compile the tile vertex shader and this includes  strata.ush. We will fix compilation issue there when we get to it.

#jira https://jira.it.epicgames.com/browse/UE-137866
#rb none
#preflight https://horde.devtools.epicgames.com/job/61d42e9f932a02483cb8d000
[FYI] charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18506891 in //UE5/Release-5.0/... via CL 18506899
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18506901 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-04 06:43:29 -05:00