//------------------------------------------------------------------ public Solver(Game game) : base(game, "Solver") { Shader.Parameters["VelocityDiffusion"].SetValue(VelocityDiffusion); Shader.Parameters["DensityDiffusion"].SetValue(DensityDiffusion); Shader.Parameters["VorticityScale"].SetValue(VorticityScale); Shader.Parameters["DT"].SetValue(DT); Shader.Parameters["HalfCellSize"].SetValue(0.5f); Velocity = CreateDefaultRenderTarget(); Density = CreateDefaultRenderTarget(); Vorticity = CreateDefaultRenderTarget(); Pressure = CreateDefaultRenderTarget(); Divergence = CreateDefaultRenderTarget(); helper = CreateDefaultRenderTarget(); Emitter = new Emitter(Game); obstacles = new Obstacles(Game); render = new Render(Game); Data = new Data(Game); permanentVelocity = Shader.Parameters["PermanentVelocity"]; }
//------------------------------------------------------------------ public Solver(Game game) : base(game, "Solver") { Shader.Parameters["VelocityDiffusion"].SetValue (VelocityDiffusion); Shader.Parameters["DensityDiffusion"].SetValue (DensityDiffusion); Shader.Parameters["VorticityScale"].SetValue (VorticityScale); Shader.Parameters["DT"].SetValue (DT); Shader.Parameters["HalfCellSize"].SetValue (0.5f); Velocity = CreateDefaultRenderTarget(); Density = CreateDefaultRenderTarget(); Vorticity = CreateDefaultRenderTarget(); Pressure = CreateDefaultRenderTarget(); Divergence = CreateDefaultRenderTarget(); helper = CreateDefaultRenderTarget(); Emitter = new Emitter(Game); obstacles = new Obstacles(Game); render = new Render(Game); Data = new Data(Game); permanentVelocity = Shader.Parameters["PermanentVelocity"]; }