Refactor engine shaders folder to have better organization

This commit is contained in:
2026-08-26 12:59:23 +02:00
parent 70155516c3
commit 14df537817
231 changed files with 409 additions and 407 deletions
@@ -677,7 +677,7 @@ void MaterialGenerator::ProcessGroupTextures(Box* box, Node* node, Value& value)
Value worldPosition = tryGetValue(node->GetBox(1), Value(VariantType::Float3, TEXT("input.WorldPosition.xyz"))).Cast(VariantType::Float3);
Value startCascade = tryGetValue(node->TryGetBox(2), 0, Value::Zero).Cast(VariantType::Uint);
value = writeLocal(VariantType::Float, String::Format(TEXT("SampleGlobalSDF({0}, {0}_Tex, {0}_Mip, {1}, {2})"), param.ShaderName, worldPosition.Value, startCascade.Value), node);
_includes.Add(TEXT("./Flax/GlobalSignDistanceField.hlsl"));
_includes.Add(TEXT("./Flax/Utils/GlobalSignDistanceField.hlsl"));
break;
}
// Sample Global SDF Gradient
@@ -690,7 +690,7 @@ void MaterialGenerator::ProcessGroupTextures(Box* box, Node* node, Value& value)
Value startCascade = tryGetValue(node->TryGetBox(3), 0, Value::Zero).Cast(VariantType::Uint);
auto distance = writeLocal(VariantType::Float, node);
auto gradient = writeLocal(VariantType::Float3, String::Format(TEXT("SampleGlobalSDFGradient({0}, {0}_Tex, {0}_Mip, {1}, {2}, {3})"), param.ShaderName, worldPosition.Value, distance.Value, startCascade.Value), node);
_includes.Add(TEXT("./Flax/GlobalSignDistanceField.hlsl"));
_includes.Add(TEXT("./Flax/Utils/GlobalSignDistanceField.hlsl"));
gradientBox->Cache = gradient;
distanceBox->Cache = distance;
value = box == gradientBox ? gradient : distance;