| 387 | |
| 388 | // clear working list |
| 389 | _drawMergers.Resize(0); |
| 390 | // keep drawObjects for next frame |
| 391 | |
| 392 | DrawFlares(); |
| 393 | _aLights.Resize(0); |
| 394 | } |
| 395 | |
| 396 | int Scene::LevelFromDistance2(LODShape* shape, float distance2, float oScale, Vector3Par direction, |
| 397 | Vector3Par viewDirection) |
| 398 | { |
| 399 | // if pixel size is lower than 2, object can be considered invisible |
| 400 | // size in pixels is |
| 401 | float scale = GetCamera()->Left(); |
| 402 | float diameter = shape->BoundingSphere() * 2 * oScale; |
| 403 | |
| 404 | if (distance2 > Square(ENGINE_CONFIG.objectsZ)) |
| 405 | { |
| 406 | return LOD_INVISIBLE; |
| 407 | } |
| 408 | |
| 409 | float pixelLimit = 0.125; |
| 410 | float detail2 = distance2 * Square(_lodInvWidth); |
| 411 | |
| 412 | if (Square(diameter) < Square(pixelLimit * scale) * detail2) |
| 413 | { |
| 414 | return LOD_INVISIBLE; |
| 415 | } |
| 416 | |
| 417 | if (shape->NLevels() < 2) |
| 418 | { |
| 419 | return 0; |
| 420 | } |
| 421 | |
| 422 | float resol2 = detail2 * Square(scale); |
| 423 | // disable decal LODs |
no test coverage detected