vault backup: 2024-03-13 21:28:44
This commit is contained in:
parent
3b2d6493ac
commit
c0159d1913
@ -341,8 +341,49 @@ bool FMaterialInstanceResource::GetParameterValue(EMaterialParameterType Type, c
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
MaterialEmitHLSL
|
MaterialEmitHLSL()=>
|
||||||
|
```c++
|
||||||
|
bool MaterialEmitHLSL(const FMaterialCompileTargetParameters& InCompilerTarget,
|
||||||
|
const FStaticParameterSet& InStaticParameters,
|
||||||
|
FMaterial& InOutMaterial,
|
||||||
|
FMaterialCompilationOutput& OutCompilationOutput,
|
||||||
|
TRefCountPtr<FSharedShaderCompilerEnvironment>& OutMaterialEnvironment)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
if (DerivativeIndex == 0)
|
||||||
|
{
|
||||||
|
const EMaterialDomain MaterialDomain = EmitContext.Material->GetMaterialDomain();
|
||||||
|
if (MaterialDomain == MD_Volume || (MaterialDomain == MD_Surface && IsSubsurfaceShadingModel(EmitMaterialData.ShadingModelsFromCompilation)))
|
||||||
|
{ const FMaterialParameterInfo SubsurfaceProfileParameterInfo(GetSubsurfaceProfileParameterName());
|
||||||
|
const FMaterialParameterMetadata SubsurfaceProfileParameterMetadata(1.f);
|
||||||
|
const Material::FExpressionParameter SubsurfaceProfileExpression(SubsurfaceProfileParameterInfo, SubsurfaceProfileParameterMetadata);
|
||||||
|
|
||||||
|
const FPreparedType SubsurfaceProfilePreparedType = EmitContext.PrepareExpression(&SubsurfaceProfileExpression, *EmitResultScope, EValueType::Float1);
|
||||||
|
const FEmitShaderExpression* SubsurfaceProfileEmitExpression = SubsurfaceProfileExpression.GetValueShader(
|
||||||
|
EmitContext,
|
||||||
|
*EmitResultScope,
|
||||||
|
EValueType::Float1,
|
||||||
|
SubsurfaceProfilePreparedType,
|
||||||
|
EValueType::Float1);
|
||||||
|
check(SubsurfaceProfileEmitExpression && SubsurfaceProfileEmitExpression->Reference);
|
||||||
|
SubsurfaceProfileShaderCode = SubsurfaceProfileEmitExpression->Reference;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
...
|
||||||
|
|
||||||
|
MaterialTemplateSource = GenerateMaterialTemplateHLSL(InCompilerTarget.ShaderPlatform,
|
||||||
|
InOutMaterial,
|
||||||
|
EmitContext,
|
||||||
|
Declarations.ToString(),
|
||||||
|
SharedCode.ToString(),
|
||||||
|
VertexCode.ToString(),
|
||||||
|
InputPixelCodePhase0,
|
||||||
|
InputPixelCodePhase1,
|
||||||
|
SubsurfaceProfileShaderCode,
|
||||||
|
OutCompilationOutput);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
调用GenerateMaterialTemplateHLSL()
|
||||||
|
|
||||||
### 是否需要Toon
|
### 是否需要Toon
|
||||||
在材质中:
|
在材质中:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user