Merge remote-tracking branch 'origin/master' into 1.9
# Conflicts: # Source/Engine/UI/GUI/Common/Button.cs
This commit is contained in:
@@ -832,4 +832,32 @@ void MaterialGenerator::WriteCustomGlobalCode(const Array<const MaterialGraph::N
|
||||
}
|
||||
}
|
||||
|
||||
ShaderGenerator::Value MaterialGenerator::VsToPs(Node* node, Box* input)
|
||||
{
|
||||
// If used in VS then pass the value from the input box
|
||||
if (_treeType == MaterialTreeType::VertexShader)
|
||||
{
|
||||
return tryGetValue(input, Value::Zero).AsFloat4();
|
||||
}
|
||||
|
||||
// Check if can use more interpolants
|
||||
if (_vsToPsInterpolants.Count() == 16)
|
||||
{
|
||||
OnError(node, input, TEXT("Too many VS to PS interpolants used."));
|
||||
return Value::Zero;
|
||||
}
|
||||
|
||||
// Check if can use interpolants
|
||||
const auto layer = GetRootLayer();
|
||||
if (!layer || layer->Domain == MaterialDomain::Decal || layer->Domain == MaterialDomain::PostProcess)
|
||||
{
|
||||
OnError(node, input, TEXT("VS to PS interpolants are not supported in Decal or Post Process materials."));
|
||||
return Value::Zero;
|
||||
}
|
||||
|
||||
// Indicate the interpolator slot usage
|
||||
_vsToPsInterpolants.Add(input);
|
||||
return Value(VariantType::Float4, String::Format(TEXT("input.CustomVSToPS[{0}]"), _vsToPsInterpolants.Count() - 1));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user