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(); }
public override void GetData(RenderTexture theTargetMap, List <Vector4> theDataList) { if (curves.Count <= 0) { return; } for (var y = 0; y < theTargetMap.height; y++) { var myCurve = curves[y % curves.Count]; for (var x = 0; x < theTargetMap.width; x++) { var value = myCurve.Evaluate(CCMath.Norm(x, 0, theTargetMap.width - 1)); theDataList.Add(new Vector4(value, 0, 0, 0)); } } }