Add missing Particle Scale getter node to Particle Emitter graph

#1343
This commit is contained in:
Wojtek Figat
2023-09-11 13:54:44 +02:00
parent 716e643f2a
commit fb27606541
4 changed files with 30 additions and 1 deletions

View File

@@ -553,6 +553,18 @@ namespace FlaxEditor.Surface.Archetypes
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(float), 0),
}
},
new NodeArchetype
{
TypeID = 112,
Title = "Particle Scale",
Description = "Particle scale.",
Flags = NodeFlags.ParticleEmitterGraph,
Size = new Float2(200, 30),
Elements = new[]
{
NodeElementArchetype.Factory.Output(0, string.Empty, typeof(Float3), 0),
}
},
// Simulation data access nodes
new NodeArchetype

View File

@@ -331,6 +331,12 @@ void ParticleEmitterGraphCPUExecutor::ProcessGroupParticles(Box* box, Node* node
value = GET_PARTICLE_ATTRIBUTE(0, float);
break;
}
// Particle Scale
case 112:
{
value = GET_PARTICLE_ATTRIBUTE(0, Float3);
break;
}
// Effect Position
case 200:
{

View File

@@ -331,6 +331,10 @@ void ParticleEmitterGPUGenerator::ProcessGroupParticles(Box* box, Node* node, Va
case 111:
value = AccessParticleAttribute(node, TEXT("Radius"), ParticleAttribute::ValueTypes::Float, AccessMode::Read);
break;
// Particle Scale
case 112:
value = AccessParticleAttribute(node, TEXT("Scale"), ParticleAttribute::ValueTypes::Float3, AccessMode::Read);
break;
// Effect Position
case 200:
value = Value(VariantType::Float3, TEXT("EffectPosition"));

View File

@@ -269,13 +269,20 @@ public:
USE_ATTRIBUTE(Lifetime, Float, 1);
break;
}
// Particle Mass
// Particle Radius
case GRAPH_NODE_MAKE_TYPE(14, 111):
{
node->UsesParticleData = true;
USE_ATTRIBUTE(Radius, Float, 0);
break;
}
// Particle Scale
case GRAPH_NODE_MAKE_TYPE(14, 112):
{
node->UsesParticleData = true;
USE_ATTRIBUTE(Scale, Float3, 0);
break;
}
// Random
case GRAPH_NODE_MAKE_TYPE(14, 208):
case GRAPH_NODE_MAKE_TYPE(14, 209):