| 1280 | // We no longer render transparent objects twice, once before water |
| 1281 | // and once after water (ticket 434); except that when fancy water is disabled |
| 1282 | // we have to draw the underwater portion of transparent objects twice. |
| 1283 | if (!m_WaterManager->WillRenderFancyWater()) |
| 1284 | { |
| 1285 | // render underwater transparent stuff before plain water; |
| 1286 | // use a clipping plane so that we only draw things below the water plane |
| 1287 | MICROLOG(L"render underwater transparent"); |
| 1288 | double eqn[] = { 0.0, -1.0, 0.0, m_WaterManager->m_WaterHeight }; |
| 1289 | glClipPlane(GL_CLIP_PLANE0, eqn); |
| 1290 | glEnable(GL_CLIP_PLANE0); |
| 1291 | RenderTransparentModels(); |
| 1292 | ogl_WarnIfError(); |
| 1293 | glDisable(GL_CLIP_PLANE0); |
| 1294 | } |
| 1295 | |
1288 | | |
1289 | | // render transparent stuff again, so it can overlap the water |
1290 | | MICROLOG(L"render transparent 2"); |
1291 | | RenderTransparentModels(); |
1292 | | ogl_WarnIfError(); |
1293 | | |
1294 | | // TODO: Maybe think of a better way to deal with transparent objects; |
1295 | | // they can appear both under and above water (seaweed vs. trees), but doing |
1296 | | // 2 renders causes (a) inefficiency and (b) darker over-water objects (e.g. |
1297 | | // trees) than usual because the transparent bits get overwritten twice. |
1298 | | // This doesn't look particularly bad, but it is noticeable if you try |
1299 | | // turning the water off. On the other hand every user will have water |
1300 | | // on all the time, so it might not be worth worrying about. |