vault backup: 2024-03-13 12:50:59

This commit is contained in:
BlueRose 2024-03-13 12:50:59 +08:00
parent b79eccb7dd
commit 93450080eb
3 changed files with 10 additions and 0 deletions

View File

@ -222,10 +222,20 @@ else if (Mat.IS_BASE_PASS)
### MaterialTemplate.ush
MaterialTemplate.ush中定义许多模版函数里面的具体内容会在HLSLMaterialTranslator.h中的**GetMaterialShaderCode()** 中添加。最后这些函数会在BassPassPixelShader.usf中调用。
#### FMaterialAttributes
MaterialTemplate.ush有一处`/** Material declarations */`之后会生成对应FMaterialAttributes结构体可以在材质编辑器的HLSL中查看生成结果。这与
- MaterialAttributeDefinitionMap.cppFMaterialAttributeDefinitionMap::InitializeAttributeMap()中定义属性。
- HLSLMaterialTranslator.cppGetMaterialShaderCode()中的`for (const FGuid& AttributeID : OrderedVisibleAttributes)`:生成对应属性结构体以及属性获取函数。
#### DerivativeAutogen.GenerateUsedFunctions()
```c++
{
FString DerivativeHelpers = DerivativeAutogen.GenerateUsedFunctions(*this);
FString DerivativeHelpersAndResources = DerivativeHelpers + ResourcesString;
//LazyPrintf.PushParam(*ResourcesString);
LazyPrintf.PushParam(*DerivativeHelpersAndResources);
}
```
### 是否需要Toon
在材质中:

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB