Deatheffect color now correctly calculated

This commit is contained in:
Tleety
2016-02-02 10:58:00 +01:00
parent 8299b99e2f
commit 9c2e459e0c
5 changed files with 38 additions and 21 deletions
+1 -1
Submodule assets updated: 01a73005d4...763d7c5c0d
+19 -15
View File
@@ -43,15 +43,25 @@
</c:RaptorCopter>
<c:Transform>
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
<Orientation X="4.16300011" Y="2654.78613" Z="0"/>
<Orientation X="4.16300011" Y="3137.18433" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="AssaultTPose">
<Components>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="0" Y="0" Z="0.300000012"/>
<ExplosionOrigin X="0" Y="1.30000007" Z="0"/>
<TimeSinceDeath>0.9332666733480437</TimeSinceDeath>
<ExplosionDuration>5</ExplosionDuration>
<EndColor A="1" B="1" G="0" R="0"/>
<RandomnessScalar>3</RandomnessScalar>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/Assault.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="-1.68900967" Y="0.527161121" Z="-1.59648728"/>
@@ -62,23 +72,17 @@
<Entity name="SecondaryWeapon">
<Components>
<c:Model>
<Resource>Models/DefenderGunBlue.mesh</Resource>
<Resource>Models/AssaultWeapon.mesh</Resource>
<Transparent>true</Transparent>
</c:Model>
<c:Transform>
<Position X="-0.519181371" Y="0.803532183" Z="0.128527239"/>
<Orientation X="0.989000022" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="SecondaryWeaponRed">
<Components>
<c:ExplosionEffect>
<ColorByDistance>true</ColorByDistance>
<Velocity X="0.200000003" Y="0.200000003" Z="0.200000003"/>
<TimeSinceDeath>0.33345697685444975</TimeSinceDeath>
<EndColor A="1" B="1" G="0.627451003" R="0.686274529"/>
</c:ExplosionEffect>
<c:Model>
<Resource>Models/DefenderGunRed.mesh</Resource>
<Transparent>true</Transparent>
@@ -105,7 +109,7 @@
<Components>
<c:Animation>
<Name>Run</Name>
<Time>0.051746205796625588</Time>
<Time>0.48512596304830424</Time>
<Speed>1</Speed>
</c:Animation>
<c:Model>
@@ -121,7 +125,7 @@
<Components>
<c:Animation>
<Name>Walk</Name>
<Time>0.21902565989713363</Time>
<Time>0.65240541714881228</Time>
<Speed>1</Speed>
</c:Animation>
<c:Model>
@@ -183,7 +187,7 @@
<Axis X="1" Y="1" Z="1"/>
</c:RaptorCopter>
<c:Transform>
<Orientation X="1264.88269" Y="1264.88269" Z="1264.88269"/>
<Orientation X="1747.31226" Y="1747.31226" Z="1747.31226"/>
</c:Transform>
</Components>
<Children>
@@ -247,7 +251,7 @@
<Axis X="0" Y="1" Z="0"/>
</c:RaptorCopter>
<c:Transform>
<Orientation X="0" Y="1061.18103" Z="0"/>
<Orientation X="0" Y="1543.6106" Z="0"/>
</c:Transform>
</Components>
<Children>
@@ -279,7 +283,7 @@
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
</c:RaptorCopter>
<c:Transform>
<Orientation X="1251.85034" Y="1788.34839" Z="536.510132"/>
<Orientation X="1589.52576" Y="2270.7627" Z="681.260559"/>
</c:Transform>
</Components>
<Children>
@@ -322,7 +326,7 @@
<Entity name="SceneColors">
<Components>
<c:SceneLight>
<Gamma>2</Gamma>
<Gamma>1.3999999761581421</Gamma>
</c:SceneLight>
<c:Transform/>
</Components>
+14 -4
View File
@@ -21,6 +21,7 @@ in VertexData{
vec3 BiTangent;
vec2 TextureCoordinate;
vec4 ExplosionColor;
float ExplosionPercentageElapsed;
}Input[];
out VertexData{
@@ -30,6 +31,7 @@ out VertexData{
vec3 BiTangent;
vec2 TextureCoordinate;
vec4 ExplosionColor;
float ExplosionPercentageElapsed;
}Output;
layout(triangles) in;
@@ -118,12 +120,17 @@ void main()
{
// calculate the max distance (s) the triangle will move
float s = (randomVelocity.x * ExplosionDuration) + (0.5 * a * pow(ExplosionDuration, 2));
float te = (length(triangleCenter2ExplosionRadius) / s);
Output.ExplosionColor = EndColor * (length(triangleCenter2ExplosionRadius) / s);
Output.ExplosionColor = EndColor;
Output.ExplosionPercentageElapsed = te;
}
else
{
Output.ExplosionColor = EndColor * timePercetage;
Output.ExplosionColor = EndColor;
Output.ExplosionPercentageElapsed = timePercetage;
}
// for every vertex on the triangle...
@@ -160,11 +167,14 @@ void main()
// if explosion color should be affected by distance instead of time...
if (ColorByDistance == true)
{
Output.ExplosionColor = vec4(1.0);
Output.ExplosionColor = EndColor;
Output.ExplosionPercentageElapsed = 0.0;
}
else
{
Output.ExplosionColor = EndColor * timePercetage;
Output.ExplosionColor = EndColor;
Output.ExplosionPercentageElapsed = timePercetage;
}
// for every vertex on the triangle...
+2 -1
View File
@@ -55,6 +55,7 @@ in VertexData{
vec3 BiTangent;
vec2 TextureCoordinate;
vec4 ExplosionColor;
float ExplosionPercentageElapsed;
}Input;
out vec4 sceneColor;
@@ -148,7 +149,7 @@ void main()
totalLighting.Specular += light_result.Specular;
}
vec4 color_result = Color * diffuseTexel * DiffuseColor * Input.ExplosionColor;
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
+2
View File
@@ -20,6 +20,7 @@ out VertexData{
vec3 BiTangent;
vec2 TextureCoordinate;
vec4 ExplosionColor;
float ExplosionPercentageElapsed;
}Output;
void main()
@@ -42,4 +43,5 @@ void main()
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
Output.ExplosionColor = vec4(1.0);
Output.ExplosionPercentageElapsed = 0.0;
}