public override IRender Render(float dt) { _passedTime = _passedTime + dt; _render.Clear(); _render.Map((x, y) => { float xt = (float)x / Width; float yt = (float)y / Height; float xx = (xt - 0.5f * (float)Math.Sin(_passedTime / 2) - 0.5f); float yy = (yt - 0.5f * (float)Math.Cos(_passedTime / 2) - 0.5f); float v = (float)Math.Sqrt(_xScale * xx * xx + _yScale * yy * yy) + (_xScale * xt) * (float)Math.Sin(_passedTime / 4) + (_yScale * yt) * (float)Math.Cos(_passedTime / 4) - _passedTime; byte r = (byte)((Math.Sin(v + _cr * Math.PI) * 0.5 + 0.5) * 255); byte g = (byte)((Math.Sin(v + _cg * Math.PI) * 0.5 + 0.5) * 255); byte b = (byte)((Math.Sin(v + _cb * Math.PI) * 0.5 + 0.5) * 255); return(new SKColor(r, g, b)); }); return(_render); }
public override IRender Render(float dt) { _render.Clear(); _particleSystem.Update(dt); _particleSystem.Render(_render); return(_render); }
/* In this method you will be able to render your effect. It will be called for * each frame of your project, assuming this layer is enabled. */ public override IRender Render(float dt) { /* Reset all pixels on the render. */ _render.Clear(); /* Update the wave simulation. */ _waveSimulation.Update(dt); /* Render the wave simulation */ _waveSimulation.Render(_render); return(_render); }
public override IRender Render(float dt) { _render.Clear(); _render.Map((x, y) => { float xt = (float)x / Width - 0.5f; float yt = (float)y / Height - 0.5f; float z = _a * (float)Math.Sin(_n * Math.PI * xt) * (float)Math.Sin(_m * Math.PI * yt) + _b * (float)Math.Sin(_m * Math.PI * xt) * (float)Math.Sin(_n * Math.PI * yt); float v = 1 - z * z; return(_color.WithScale(v)); }); return(_render); }
public override IRender Render(float dt) { _passedTime = _passedTime + dt; _render.Clear(); _render.Map((x, y) => { float v = _kx * x + _ky * y - _passedTime; byte r = (byte)((Math.Sin(v + _cr * Math.PI) * 0.5 + 0.5) * 255); byte g = (byte)((Math.Sin(v + _cg * Math.PI) * 0.5 + 0.5) * 255); byte b = (byte)((Math.Sin(v + _cb * Math.PI) * 0.5 + 0.5) * 255); return(new SKColor(r, g, b)); }); return(_render); }
/* In this method you will be able to render your effect. It will be called for * each frame of your project, assuming this layer is enabled. */ public override IRender Render(float dt) { /* Add a new droplet with random color on each beat. */ if (_featureCache.IsBeat()) { var color = _api.CreateRandomColor(); _waveSimulation.AddDrop(Width / 2, color); } /* Reset all pixels on the render. */ _render.Clear(); /* Update the wave simulation. */ _waveSimulation.Update(dt); /* Render the wave simulation */ _waveSimulation.Render(_render); return(_render); }
public override IRender Render(float dt) { _passedTime = _passedTime + dt; _render.Clear(); _render.Map((x, y, c) => { float xx = (float)x / Width - _x0; float yy = (float)y / Height - _y0; float v = (float)Math.Sqrt(_xScale * xx * xx + _yScale * yy * yy) - _passedTime; byte r = (byte)((Math.Sin(v + _cr * Math.PI) * 0.5 + 0.5) * 255); byte g = (byte)((Math.Sin(v + _cg * Math.PI) * 0.5 + 0.5) * 255); byte b = (byte)((Math.Sin(v + _cb * Math.PI) * 0.5 + 0.5) * 255); return(new SKColor(r, g, b)); }); return(_render); }