Version = 1.8.2.25321;
CParticleEffect	$LOCAL$/Resource
{
	OnSpawn = "$LOCAL$/Spawner";
	CustomAttributes = "$LOCAL$/_GlobalAttributes";
	SpatialLayers = "$LOCAL$/CParticleSpatialLayerList_45B77F40";
	Autostart = true;
}
CActionFactoryWithChilds	$LOCAL$/Spawner
{
	EditorInfosPosition = int2(-390, -188);
	ChildList = 
	{
		"$LOCAL$/Coal",
	};
}
CParticleAttributeList	$LOCAL$/_GlobalAttributes
{
	EditorInfosPosition = int2(-756, 216);
	AttributeList = 
	{
		"$LOCAL$/CParticleAttributeDeclaration_2C89021B",
		"$LOCAL$/CParticleAttributeDeclaration_EC421603",
		"$LOCAL$/CParticleAttributeDeclaration_495DBF6D",
		"$LOCAL$/CParticleAttributeDeclaration_6687FACB",
	};
}
CParticleSpatialLayerList	$LOCAL$/CParticleSpatialLayerList_45B77F40
{
	LayerList = 
	{
		"$LOCAL$/CParticleSpatialDescriptor_CAA86F03",
	};
}
CParticleSpatialDescriptor	$LOCAL$/CParticleSpatialDescriptor_CAA86F03
{
	Global = true;
	LayerName = "Flame";
	CustomFields = 
	{
		"$LOCAL$/CParticleFieldDeclaration_C2A17CC5",
	};
}
CParticleDescriptor	$LOCAL$/CParticleDescriptor_67756E3B
{
	EditorInfosPosition = int2(-392, -44);
	Renderer = "$LOCAL$/CParticleRenderer_Billboard_B1F43C1A";
	CustomFields = 
	{
		"$LOCAL$/CParticleFieldDeclaration_F0251FE5",
		"$LOCAL$/CParticleFieldDeclaration_91419A0C",
		"$LOCAL$/CParticleFieldDeclaration_7F170321",
		"$LOCAL$/CParticleFieldDeclaration_CF702789",
		"$LOCAL$/CParticleFieldDeclaration_4E882652",
	};
	Samplers = 
	{
		"$LOCAL$/CParticleSamplerCurve_0E636D7A",
	};
	SpawnEvaluator = "$LOCAL$/CCompilerSyntaxNodeExpression_B9EF55EE";
	States = 
	{
		"$LOCAL$/CParticleState_9B929449",
	};
}
CParticleRenderer_Billboard	$LOCAL$/CParticleRenderer_Billboard_B1F43C1A
{
	BillboardingMaterial = AlphaBlend_Additive_Soft;
	Diffuse = "Textures/Fx/Coal_01.png";
	AtlasDefinition = "Textures/Fx/AtlasX2.pkat";
	AxisField = "";
	SoftnessDistance = 5.0000000e+003;
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_F0251FE5
{
	FieldName = "Color";
	FieldType = float4;
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_91419A0C
{
	FieldName = "CoalColor";
	FieldType = float3;
}
CCompilerSyntaxNodeExpression	$LOCAL$/CCompilerSyntaxNodeExpression_B9EF55EE
{
	EditorInfosPosition = int2(-508, 22);
	Expression = "function void	Eval()
{
	Life = infinity;
	Size = rand(0.01,0.04);
	
	Position = (vrand().x0z * rand(0.1, 1)) * Zone;
	
	Rotation = rand(-pi, pi);
	
	TextureID = rand(0, 4);
	
	CoalColor = float3(rand(0, 0.004));
	BurnColor = float3(rand(8, 10), rand(0.5, 1), 0);
	
	CoalTemp = 0;		// Initial temperature of the coal
}
";
}
CParticleState	$LOCAL$/CParticleState_9B929449
{
	EditorInfosPosition = int2(-508, 65);
	StateName = "State_0";
	Evolvers = 
	{
		"$LOCAL$/CParticleEvolver_Script_AADC3440",
	};
}
CParticleEvolver_Script	$LOCAL$/CParticleEvolver_Script_AADC3440
{
	Expression = "$LOCAL$/CCompilerSyntaxNodeExpression_00A0C803";
}
CCompilerSyntaxNodeExpression	$LOCAL$/CCompilerSyntaxNodeExpression_00A0C803
{
	Expression = "function void	Eval()
{
    // Spatial Layers4 let you insert any Particle Fields values into a kind-of world space hash grid
	// Then you can query/sample those values
	// Here we query \"Heat\" from \"Flame\" which is inserted by the FlameThrower_Ribbon.pkfx
	float	h = spatialLayers.Flame.Heat.sumKernel(Position, HeatRadius, Heat_Propagation);
	
	// If there is nothing, sampling will return infinity
	float	ifQuerie = select(0, h, h != infinity);


	// Coals takes time to burn and cool down
	// First we compare the initial temperature with the fire temperature
	float	tempChange = ifQuerie - CoalTemp;
	
	// This line is here in cas of sudden change of framerate
	float	bugFix = min(dt * HeatTolerance, 1);
	
	// We are adding the difference of temperature to the coal\'s initial temperature
	CoalTemp += bugFix * tempChange;
	
	// Now the color depend on the Coal\'s temperature
	float3	burnColor = lerp(CoalColor, BurnColor, CoalTemp);

	Color = float4(burnColor, 1);
}
";
}
CActionFactoryParticleSpawnerBase	$LOCAL$/Coal
{
	EditorInfosPosition = int2(-288, -61);
	Descriptor = "$LOCAL$/CParticleDescriptor_67756E3B";
	FluxFactorExpression = "Coal";
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_7F170321
{
	FieldName = "BurnColor";
	FieldType = float3;
}
CParticleAttributeDeclaration	$LOCAL$/CParticleAttributeDeclaration_2C89021B
{
	AttributeName = "HeatRadius";
	DefaultValueF4 = float4(6.0000002e-001, 0.0000000e+000, 0.0000000e+000, 0.0000000e+000);
	HasMin = true;
	MaxValueF4 = float4(1.0000000e+000, 1.0000000e+000, 1.0000000e+000, 1.0000000e+000);
	MaxValueI4 = int4(10, 10, 10, 10);
}
CParticleSamplerCurve	$LOCAL$/CParticleSamplerCurve_0E636D7A
{
	SamplerName = "Heat_Propagation";
	Times = 
	{
		0.0000000e+000,
		1.0000000e+000,
	};
	FloatValues = 
	{
		1.0000000e+000,
		0.0000000e+000,
	};
	FloatTangents = 
	{
		0.0000000e+000,
		0.0000000e+000,
		-9.8009247e-001,
		0.0000000e+000,
	};
	MinLimits = float4(0.0000000e+000, 0.0000000e+000, 0.0000000e+000, 0.0000000e+000);
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_C2A17CC5
{
	FieldName = "Heat";
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_CF702789
{
	FieldName = "CoalTemp";
}
CParticleAttributeDeclaration	$LOCAL$/CParticleAttributeDeclaration_EC421603
{
	AttributeName = "Coal";
	DefaultValueF4 = float4(1.5000000e+003, 0.0000000e+000, 0.0000000e+000, 0.0000000e+000);
	HasMin = true;
	MaxValueF4 = float4(1.0000000e+004, 1.0000000e+000, 1.0000000e+000, 1.0000000e+000);
	MaxValueI4 = int4(10, 10, 10, 10);
}
CParticleAttributeDeclaration	$LOCAL$/CParticleAttributeDeclaration_495DBF6D
{
	AttributeName = "Zone";
	DefaultValueF4 = float4(1.0000000e+000, 0.0000000e+000, 0.0000000e+000, 0.0000000e+000);
	HasMin = true;
	MaxValueF4 = float4(5.0000000e+000, 1.0000000e+000, 1.0000000e+000, 1.0000000e+000);
	MaxValueI4 = int4(10, 10, 10, 10);
}
CParticleAttributeDeclaration	$LOCAL$/CParticleAttributeDeclaration_6687FACB
{
	AttributeName = "HeatTolerance";
	DefaultValueF4 = float4(8.0000001e-001, 0.0000000e+000, 0.0000000e+000, 0.0000000e+000);
	HasMin = true;
	MaxValueF4 = float4(5.0000000e+000, 1.0000000e+000, 1.0000000e+000, 1.0000000e+000);
	MaxValueI4 = int4(10, 10, 10, 10);
}
CParticleFieldDeclaration	$LOCAL$/CParticleFieldDeclaration_4E882652
{
	FieldName = "Rotation";
}
