Mid conversion to render sob list

This commit is contained in:
lawnjelly 2019-09-25 12:28:22 +01:00 committed by GitHub
parent 7f5eb565e1
commit 02184f2022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 21 deletions

View File

@ -344,11 +344,6 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
{ {
LSob &sob = manager.m_SOBs[n]; LSob &sob = manager.m_SOBs[n];
// already determined to be visible through another portal
//if (sob.m_bVisible)
//continue;
//LPRINT_RUN(2, "sob " + itos(n) + " " + sob.GetSpatial()->get_name()); //LPRINT_RUN(2, "sob " + itos(n) + " " + sob.GetSpatial()->get_name());
// already determined to be visible through another portal // already determined to be visible through another portal
if (manager.m_BF_visible_SOBs.GetBit(n)) if (manager.m_BF_visible_SOBs.GetBit(n))
@ -388,8 +383,8 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
//sob.m_bSOBVisible = true; //sob.m_bSOBVisible = true;
// sob is renderable and visible (not shadow only) // sob is renderable and visible (not shadow only)
manager.m_BF_visible_SOBs.SetBit(n, true); manager.m_BF_visible_SOBs.SetBit(n, true);
//manager.m_BF_render_SOBs.SetBit(n, true); manager.m_BF_render_SOBs.SetBit(n, true);
//manager.m_RenderList_SOBs.push_back(n); manager.m_RenderList_SOBs.push_back(n);
} }
} // for through sobs } // for through sobs
@ -440,23 +435,12 @@ void LRoom::DetermineVisibility_Recursive(LRoomManager &manager, int depth, cons
{ {
int port_id = m_iFirstPortal + port_num; int port_id = m_iFirstPortal + port_num;
// ignore if the portal we are looking in from
// is this needed? surely the portal we are looking in from is in another room?
// if (port_id == portalID_from)
// {
// LPRINT_RUN(2, "\tIGNORING PORTAL LOOKING IN FROM");
// continue;
// }
const LPortal &port = manager.m_Portals[port_id]; const LPortal &port = manager.m_Portals[port_id];
// have we already handled the room on this frame? // have we already handled the room on this frame?
// get the room pointed to by the portal // get the room pointed to by the portal
LRoom * pLinkedRoom = &manager.Portal_GetLinkedRoom(port); LRoom * pLinkedRoom = &manager.Portal_GetLinkedRoom(port);
// if (pLinkedRoom->m_uiFrameTouched == manager.m_uiFrameCounter)
// continue;
// cull by portal angle to camera. // cull by portal angle to camera.
// Note we need to deal with 'side on' portals, and the camera has a spreading view, so we cannot simply dot // Note we need to deal with 'side on' portals, and the camera has a spreading view, so we cannot simply dot
// the portal normal with camera direction, we need to take into account angle to the portal itself. // the portal normal with camera direction, we need to take into account angle to the portal itself.

View File

@ -61,7 +61,7 @@ void LRoomConverter::Convert(LRoomManager &manager)
// make sure manager bitfields are the correct size for number of objects // make sure manager bitfields are the correct size for number of objects
int num_sobs = LMAN->m_SOBs.size(); int num_sobs = LMAN->m_SOBs.size();
LPRINT(5,"Total SOBs " + itos(num_sobs)); LPRINT(5,"Total SOBs " + itos(num_sobs));
//LMAN->m_BF_render_SOBs.Create(num_sobs); LMAN->m_BF_render_SOBs.Create(num_sobs);
LMAN->m_BF_visible_SOBs.Create(num_sobs); LMAN->m_BF_visible_SOBs.Create(num_sobs);

View File

@ -625,8 +625,8 @@ void LRoomManager::FrameUpdate()
// clear the visible room list to write to each frame // clear the visible room list to write to each frame
m_pCurr_VisibleRoomList->clear(); m_pCurr_VisibleRoomList->clear();
//m_RenderList_SOBs.clear(); m_RenderList_SOBs.clear();
//m_BF_render_SOBs.Blank(); m_BF_render_SOBs.Blank();
m_BF_visible_SOBs.Blank(); m_BF_visible_SOBs.Blank();
// get the camera desired and make into lcamera // get the camera desired and make into lcamera

View File

@ -49,6 +49,12 @@ class LRoomManager : public Spatial {
// keep track of which rooms are visible, so we can hide ones that aren't hit that were previously on // keep track of which rooms are visible, so we can hide ones that aren't hit that were previously on
Lawn::LBitField_Dynamic m_BF_visible_rooms; Lawn::LBitField_Dynamic m_BF_visible_rooms;
// the render list is all objects that are in view,
// and also objects out of view but casting shadows INTO the view
LVector<int> m_RenderList_SOBs;
Lawn::LBitField_Dynamic m_BF_render_SOBs;
// visible bit marks in view, if not set, it is a shadow caster only // visible bit marks in view, if not set, it is a shadow caster only
Lawn::LBitField_Dynamic m_BF_visible_SOBs; Lawn::LBitField_Dynamic m_BF_visible_SOBs;