Commit Graph

777 Commits

Author SHA1 Message Date
jason hoerner
14b74f7fa9 Material Editor: Added statistics for preshaders, and dumping of preshader expressions and parameter fetches in human readable form to the HLSL source. Similar statistics had been implemented in debug code to optimize a worst case shader, but now they are user facing to allow anyone to do similar content optimizations.
#jira UE-198495
#rb massimo.tristano

[CL 29857899 by jason hoerner in ue5-main branch]
2023-11-20 20:34:05 -05:00
marc audy
763a611985 Fix C4072 warnings
#rnx

[CL 29852844 by marc audy in ue5-main branch]
2023-11-20 17:26:53 -05:00
massimo tristano
f0d65d85e5 Introduced Material Translation DDC caching.
This change implements a caching mechanism for material translation results. After translating a material, the intermediate results are now stored in the DDC (Derived Data Cache) for future retrieval. When the material translator is requested to translate a material, it first checks the DDC to see if th combination of specified base material, parameter sets, and platform-specific data is already present in the cache. If this key is found, the intermediate results are pulled and returned, avoiding expensive material translation and decoupling material translation from material shader generation.

The significant advantage of this change is that modifications to the material template source file or any dependent shader file no longer trigger a material retranslation. The material shader can still be generated correctly, using the cached translation results, which ensures that material string generation always uses up-to-date input files.

#jira UE-167483
#rb Jason.Nadro

[CL 29816298 by massimo tristano in ue5-main branch]
2023-11-17 14:23:25 -05:00
sebastien hillaire
69517a56d0 Substrate - re-instated remove dead code (from 29421605) to be safe.
[FYI] charles.derousiers

[CL 29688889 by sebastien hillaire in ue5-main branch]
2023-11-13 13:21:33 -05:00
dmitriy dyomin
e947de61d9 Moved FReadOnlyCVARCache to RenderCore module
Cleaned up and made more rendering read-only cvars go through this cache
It now can cache platform specific cvars, in non-editor builds
#rb jack.porter

[CL 29681907 by dmitriy dyomin in ue5-main branch]
2023-11-13 09:13:11 -05:00
marc audy
59f0feb3e4 Fix warning V595: The pointer was utilized before it was verified against nullptr.
#rnx

[CL 29459035 by marc audy in ue5-main branch]
2023-11-04 01:30:32 -04:00
marc audy
413df66835 Fix warning V547: Expression 'CompilationOutput.RootOperatorIndex >= 0' is always true. Unsigned type value is always >= 0.
[CODEREVIEW] Sebastien.Hillaire

[CL 29439222 by marc audy in ue5-main branch]
2023-11-03 21:57:30 -04:00
jian ru
893e4d7b13 Various fixes for the WIP FMaterialHLSLGenerator:
- Make various vertex factories work with the new translator
- Fix EnableNewHLSLTranslator check box not showing up when material domain is UI
- Implemented GenerateHLSLExpression for ObjectLocalBounds
- Fix per instance random/custom data not working for some material instances
- Update material function calls before generating a HLSL tree. This is needed to avoid mismatch of inputs/outputs between function calls and the material functions
- Fix SubsurfaceColor having the incorrect default value for two-sided foliage materials
- ShadingModel material property is now prepared before other properties. This is needed because some other properties depend on shading models. For example, SubsurfaceColor has a different default value for two-sided foliages
- For MP_ShadingModel, falls back to the first mateiral shading model if per pixel shading model is not allowed
- Added some error checkings that are present in the old translator but not in the new one
- Fix dynamic parameter and per instance custom data not working with the new translator
- Fix a bug with user vertex interpolators when the new translator is used. The bug is, when there are multiple material graph paths that use the same vertex interpolator and the component usages are different in those paths, the last component usage will override all previous usages causing some components being discarded because the translator think they are not used
- Component swizzling on a numeric scalar now replicates the scalar to YZW instead of returning zeros. This is also the behavior in the old translator

[FYI] tom.holmes, Danny.Kabrane, massimo.tristano, Jason.Nadro

[CL 29098392 by jian ru in ue5-main branch]
2023-10-25 15:08:53 -04:00
sameer mirza
47e7b1f9a3 Material Root node inline control updates
#jira UE-160029
#rb massimo.tristano

[CL 29049032 by sameer mirza in ue5-main branch]
2023-10-24 13:18:43 -04:00
sameer mirza
ce6f8cd1ba Material Editor: Disable inline sliders for now (pending UX revision) and revert to text input
#jira UE-160029
#rb Jason.Nadro, massimo.tristano

[CL 29025800 by sameer mirza in ue5-main branch]
2023-10-23 20:49:55 -04:00
sameer mirza
2d63804d3f Material Root node inline control updates
#jira UE-160029
#rb massimo.tristano

[CL 28924679 by sameer mirza in ue5-main branch]
2023-10-19 13:19:25 -04:00
charles derousiers
7fb5d6b707 * SubstrateMaterialBSDFCount -> SubstrateMaterialEffectiveClosureCount
* SubstrateBSDFCount -> SubstrateClosureCount
* SUBSTRATE_CLAMPED_BSDF_COUNT -> SUBSTRATE_CLAMPED_CLOSURE_COUNT

#rb none
[FYI] sebastien.hillaire

[CL 28744074 by charles derousiers in ue5-main branch]
2023-10-13 04:02:08 -04:00
dmytro ivanov
29dc070c2d Report issues in base material for shader platforms not covered by current RHI feature levels.
#rb Jack.Porter

[CL 28658986 by dmytro ivanov in ue5-main branch]
2023-10-11 07:36:26 -04:00
sameer mirza
7e5d316534 Fix "Promote to Variable" in Root node pins only creating Vector nodes.
#jira UE-160029
#rb Jason.Nadro

[CL 28540497 by sameer mirza in ue5-main branch]
2023-10-06 10:53:19 -04:00
sameer mirza
34dc17e477 Open/Close state of the Material Editors Detail Panel Parameter groups are not preserved through static-switch param changes or after Undo/Redo
#jira UE-114496, UE-112580
#rb Jason.Nadro

[CL 28502793 by sameer mirza in ue5-main branch]
2023-10-05 12:08:32 -04:00
guillaume abadie
24ea91de21 Implements UMaterialInstance::bHasPixelAnimation
#rb jeremy.moore
#jira UE-179496, UE-187459
#tests win64

[CL 28496988 by guillaume abadie in ue5-main branch]
2023-10-05 09:28:23 -04:00
charles derousiers
994053ebd6 Clean up Substrate material complexity to remove duplicated and non-consistent logic.
#rb sebastien.hillaire

[CL 28494809 by charles derousiers in ue5-main branch]
2023-10-05 08:25:08 -04:00
sameer mirza
93b81e86c5 Fix build health issue Copyright Notice missing caused by an extra line at the top of the file
#rb trivial
#jira UE-194789

[CL 28448981 by sameer mirza in ue5-main branch]
2023-10-04 06:41:52 -04:00
sameer mirza
e8778cbac6 Check Parameters All ON / OFF with context menu
#jira UE-194789
#rb massimo.tristano, Jason.Nadro

[CL 28448140 by sameer mirza in ue5-main branch]
2023-10-04 06:05:59 -04:00
dmytro ivanov
253f2b03a5 Improve platform stats and material editor compilation warnings.
#rb Jack.Porter

[CL 28382284 by dmytro ivanov in ue5-main branch]
2023-10-02 12:31:34 -04:00
sameer mirza
678a7d5a5a Material Root Node Inline Editting
Support for sliders

#jira UE-160029
#rb Massimo.Tristano

[CL 28373526 by sameer mirza in ue5-main branch]
2023-10-02 08:10:54 -04:00
charles derousiers
7a8788dd6f Fix material function crash with Substrate on preview.
There were two issues:
* The material function preview was not correctly converting material attribute output.
* The cached expression were not populated, causing the IsMaterialAttributeOutput() function to not return the correct value.

Down the line, this was causing material attribute data to be connected to a float3 input causing a crash down the line.

#rb none
[FYI] sebastien.hillaire, massimo.tristano

[CL 28180761 by charles derousiers in ue5-main branch]
2023-09-25 03:14:01 -04:00
jason nadro
bbe8eb58e0 Fix for conflicting localization messages with material editor errors.
- Warning_CompileErrorsInMaterial was used twice for two different error messages.
- Renamed the second one to Warning_CompileErrorsInMaterialInstance, since it was an error message specific to material instances.

#rb Jon.Cain
#jira UE-195762

[CL 28033767 by jason nadro in ue5-main branch]
2023-09-20 09:38:01 -04:00
sebastien hillaire
4d3a2813b8 Clarified the message shown on SMaterialEditorSubstrateWidget when Substrate is disabled.
#rb none

[CL 28028857 by sebastien hillaire in ue5-main branch]
2023-09-20 04:17:15 -04:00
dmytro ivanov
9dba280cc1 Show material hierarchy in platform stats and warn if derived material instances fail to compile
#rb Jack.Porter

[CL 27909604 by dmytro ivanov in ue5-main branch]
2023-09-15 05:04:46 -04:00