1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-08 06:06:51 +02:00

fix visibility check for renderEnvironment

This commit is contained in:
XProger
2018-08-27 08:43:56 +03:00
parent 73f20b9b9d
commit f46d638fe7
2 changed files with 11 additions and 14 deletions

View File

@@ -791,13 +791,13 @@ struct WaterCache {
y = Core::viewportDef.y; y = Core::viewportDef.y;
} else } else
x = y = 0; x = y = 0;
#ifdef _OS_IOS
Core::setTarget(refract, RT_LOAD_DEPTH | RT_STORE_COLOR | RT_STORE_DEPTH); if (screen) { // only for iOS devices
blitTexture(screen); Core::setTarget(refract, RT_LOAD_DEPTH | RT_STORE_COLOR | RT_STORE_DEPTH);
Core::setTarget(screen, RT_LOAD_COLOR | RT_LOAD_DEPTH | RT_STORE_COLOR); blitTexture(screen);
#else Core::setTarget(screen, RT_LOAD_COLOR | RT_LOAD_DEPTH | RT_STORE_COLOR);
Core::copyTarget(refract, 0, 0, x, y, Core::viewportDef.width, Core::viewportDef.height); // copy framebuffer into refraction texture } else
#endif Core::copyTarget(refract, 0, 0, x, y, Core::viewportDef.width, Core::viewportDef.height); // copy framebuffer into refraction texture
} }
void simulate() { void simulate() {

View File

@@ -440,19 +440,16 @@ struct Level : IGame {
Core::Pass tmpPass = Core::pass; Core::Pass tmpPass = Core::pass;
Core::eye = 0.0f; Core::eye = 0.0f;
// TODO: fix for wrong room visibility checks, FIX IT! int16 rIndex = roomIndex;
int roomsCount = 0; level.getSector(rIndex, pos); // fix room index for overlapped blocks
int roomsList[256];
for (int i = 0; i < level.roomsCount; i++)
roomsList[roomsCount++] = i;
// -----
// render level into cube faces or texture images // render level into cube faces or texture images
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
setupCubeCamera(pos, i); setupCubeCamera(pos, i);
Core::pass = pass; Core::pass = pass;
Texture *target = (targets[0]->opt & OPT_CUBEMAP) ? targets[0] : targets[i * stride]; Texture *target = (targets[0]->opt & OPT_CUBEMAP) ? targets[0] : targets[i * stride];
Core::setTarget(target, RT_CLEAR_COLOR | RT_CLEAR_DEPTH | RT_STORE_COLOR, i); Core::setTarget(target, RT_CLEAR_COLOR | RT_CLEAR_DEPTH | RT_STORE_COLOR, i);
renderView(roomIndex, false, false, roomsCount, roomsList); renderView(rIndex, false, false);
} }
Core::pass = tmpPass; Core::pass = tmpPass;