Add reverse and scalar for ColorByDistance
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
<RandomnessScalar>1</RandomnessScalar>
|
||||
<Velocity X="2" Y="2"/>
|
||||
<ColorByDistance>0</ColorByDistance>
|
||||
<!--<ReverseAnimation>0</ReverseAnimation>-->
|
||||
<!--<Wireframe>0</Wireframe>-->
|
||||
<ExponentialAccelaration>0</ExponentialAccelaration>
|
||||
<Pulsate>0</Pulsate>
|
||||
<Reverse>0</Reverse>
|
||||
<ColorDistanceScalar>1</ColorDistanceScalar>
|
||||
</ExplosionEffect>
|
||||
@@ -42,9 +42,6 @@
|
||||
<xs:element name="ColorByDistance" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Change the color by its moved distance instead of by its time</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<!--<xs:element name="ReverseAnimation" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Implosions are cooler</xs:documentation></xs:annotation>
|
||||
</xs:element>-->
|
||||
<!--<xs:element name="Wireframe" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Enable/disable wireframe</xs:documentation></xs:annotation>
|
||||
</xs:element>-->
|
||||
@@ -57,6 +54,9 @@
|
||||
<xs:element name="Reverse" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Reverse the effect</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="ColorDistanceScalar" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Scale the distance of the color change</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -14,10 +14,10 @@ uniform vec2 Velocity;
|
||||
uniform bool ColorByDistance;
|
||||
uniform bool ExponentialAccelaration;
|
||||
uniform bool Reverse;
|
||||
uniform float ColorDistanceScalar;
|
||||
//uniform bool Gravity;
|
||||
//uniform bool Rotation;
|
||||
//uniform bool MaxRadius;
|
||||
//uniform bool Pulsate;
|
||||
|
||||
in VertexData{
|
||||
vec3 Position;
|
||||
@@ -146,7 +146,7 @@ void main()
|
||||
// if explosion color should be affected by distance instead of time...
|
||||
if (ColorByDistance == true)
|
||||
{
|
||||
Output.ExplosionPercentageElapsed = (length(triangleCenter2ExplosionRadius) / maxDistance) * isInsideBlastRadius;
|
||||
Output.ExplosionPercentageElapsed = (length(triangleCenter2ExplosionRadius) / maxDistance) * isInsideBlastRadius * ColorDistanceScalar;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -157,21 +157,8 @@ void main()
|
||||
for (int i = 0; i < gl_in.length(); i++)
|
||||
{
|
||||
// move the triangle to the blast radius
|
||||
//if(Reverse == false)
|
||||
//{
|
||||
ExplodedPosition = Input[i].Position + (triangleCenter2ExplosionRadius * isInsideBlastRadius);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // TODO:
|
||||
// // Remove ifs
|
||||
// // account for randomness
|
||||
// // account for velocity
|
||||
// // account for color
|
||||
//
|
||||
// ExplodedPosition = Input[i].Position + (triangleCenter2ExplosionRadius * maxDistance /** (ExplosionDuration - TimeSinceDeath)*/);
|
||||
//}
|
||||
|
||||
ExplodedPosition = Input[i].Position + (triangleCenter2ExplosionRadius * isInsideBlastRadius);
|
||||
|
||||
// pass through vertex data
|
||||
PassThingsThrough(i);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user