Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rdeioris/glTFRuntime
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed May 30, 2023
2 parents b9c2a99 + 73b6001 commit aab659d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Source/glTFRuntime/Private/glTFRuntimeParserMaterials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,15 @@ UMaterialInterface* FglTFRuntimeParser::BuildMaterial(const int32 Index, const F
ApplyMaterialFloatFactor(RuntimeMaterial.bKHR_materials_clearcoat, "clearcoatFactor", RuntimeMaterial.ClearCoatFactor);
ApplyMaterialFloatFactor(RuntimeMaterial.bKHR_materials_clearcoat, "clearcoatRoughnessFactor", RuntimeMaterial.ClearCoatRoughnessFactor);

for (const TPair<FString, float>& Pair : MaterialsConfig.ScalarParamsOverrides)
{
float ScalarValue = 0;
if (Material->GetScalarParameterValue(*Pair.Key, ScalarValue))
{
Material->SetScalarParameterValue(*Pair.Key, Pair.Value);
}
}

for (const TPair<FString, float>& Pair : MaterialsConfig.ParamsMultiplier)
{
float ScalarValue = 0;
Expand Down
3 changes: 3 additions & 0 deletions Source/glTFRuntime/Public/glTFRuntimeParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ struct FglTFRuntimeMaterialsConfig
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "glTFRuntime")
UMaterialInterface* VertexColorOnlyMaterial;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "glTFRuntime")
TMap<FString, float> ScalarParamsOverrides;

FglTFRuntimeMaterialsConfig()
{
CacheMode = EglTFRuntimeCacheMode::ReadWrite;
Expand Down

0 comments on commit aab659d

Please sign in to comment.