public float EffectBlend(CCEffectData theData, float theBlend) { switch (theBlend) { case 0: return(0); case 1: return(1); } var myOffsetSum = modulation.OffsetSum() * blendAmp; var myModulation = modulation.Modulation(theData) * blendAmp; var myBlend = (myModulation - myOffsetSum) + theBlend * (1 + myOffsetSum * 2); myBlend = CCMath.Saturate(myBlend); if (interpolator) { myBlend = interpolator.Interpolate(myBlend); } return(myBlend); }
private static void RenderGraph(IReadOnlyList <float> theList, Color theColor, float theY0, float theY1, float theMax) { GL.Begin(GL.LINE_STRIP); GL.Color(theColor); for (var i = 0; i < theList.Count; i++) { var x = (float)i / (theList.Count - 1); var y = CCMath.Blend(theY0, theY1, CCMath.Saturate(CCMath.Norm(theList[i], -theMax, theMax))); GL.Vertex3(x, y, 0); } GL.End(); }