| 350 | } |
| 351 | |
| 352 | void EnvironmentPainter::drawRays( |
| 353 | float pixelRatio, SkyRenderData const& sky, Vec2F start, float length, double time, float alpha) { |
| 354 | // All magic constants are either 2PI or arbritrary to allow the Perlin to act |
| 355 | // as a PRNG |
| 356 | float sectorWidth = 2 * Constants::pi / RayCount; // Radians |
| 357 | Vec3B color = sky.topRectColor.toRgb(); |
| 358 | |
| 359 | for (int i = 0; i < RayCount; i++) |
| 360 | drawRay(pixelRatio, |
| 361 | sky, |
| 362 | start, |
| 363 | sectorWidth * (std::abs(m_rayPerlin.get(i * 25)) * RayWidthVariance + RayMinWidth), |
| 364 | length, |
| 365 | i * sectorWidth + m_rayPerlin.get(i * 314) * RayAngleVariance, |
| 366 | time, |
| 367 | color, |
| 368 | alpha); |
| 369 | |
| 370 | m_renderer->flush(); |
| 371 | } |
| 372 | |
| 373 | void EnvironmentPainter::drawRay(float pixelRatio, |
| 374 | SkyRenderData const& sky, |