- Material property output activeness is now deferred. Previously, it was checked during tree generation. It needs to be deferred because the tree is shared between a base material and its instances. An inactive property in base can be active in an instance.
- For FExpressionSetStructField, do not generate a previous frame field expression if the field isn't requested.
- Implemented GenerateHLSLExpression for UMaterialExpressionVolumetricCloudEmptySpaceSkippingInput and UMaterialExpressionVolumetricCloudEmptySpaceSkippingOutput.
- Fallback to preview values (if allowed) for material function inputs connected to invalid reroute nodes.
- FExpressionTextureSample now falls back to hardware derivatives if analytic derivatives fail to prepare.
- Added virtual function GetPreviewExpression to FExpression. Some expressions don't have numeric values and cannot be previewed directly. Those expressions should override this virtual function to return numeric preview expressions that represent their preview values. Also implemented the virtual function for FExpressionParameter.
- Added SeenStaticParameterValues to FEmitContext. For some reasons, users can create static parameter nodes with the same name but different default values. Use the first default value seen to keep things consistent.
- FMaterialResource::HasVertexPositionOffsetConnected() now queries cached expression data instead of the base material because the answer can change in instances.
#rb tom.holmes
[FYI] tom.holmes, jason.nadro, danny.kabrane, massimo.tristano
[CL 30770932 by jian ru in ue5-main branch]
- This is in preparation for removing the older material statistics window in the Material Editor.
todo: So much copy pasta. It should be data driven and easy to add a new stat.
#rb wouter.dek
#tests [Editor][Win64] Opening materials in the material with platform stats open
[CL 30508891 by jason nadro in ue5-main branch]
- This is in preparation for removing the older material statistics window in the Material Editor.
todo: So much copy pasta. It should be data driven and easy to add a new stat.
#rb jason.hoerner
#tests [Editor][Win64] Opening materials in the material with platform stats open
[CL 30429065 by jason nadro in ue5-main branch]
- Shader stats are simply key (FName) and value (POD types) that are stored per-shader.
- A Shader Statistic is a variant that can take on the following POD types: bool, float, int32, uint32
- Currently don't support strings since those weren't as trivial to implement (needed conversion and special case code to support serializing these to the memory images required by shader maps)
- Adds another shader statistics row in the Material Editor that will show the platform specific stats.
- The platform statistics are turned into a comma and newline separated string that is displayed to the user.
- Bump the shader output worker version since I'm changing the output file format (to contain the stats).
- The shader compiler output stores the stats as a `TMap<FString, FShaderStatVariant>`. Serializing across FNames between Shader Compiler Worker and the main process wasn't working (different name tables).
- When storing and serializing the stats to the shader map we convert them to FNames. (see `FShader::FShader()`)
#rb dan.elksnitis
[CL 30394059 by jason nadro in ue5-main branch]
[FYI] massimo.tristano
Original CL Desc
-----------------------------------------------------------------
Material Editor - Made material translation DDC query async to material translation (running at the same time), so that the process that completes first will be used instead of doing them both serially.
#rb dan.elksnitis
#jira UE-193797
[CL 30121479 by massimo tristano in ue5-main branch]
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]
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]
- 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]