Hi!
I've quickly hacked up a screen space based visibility tester. No luck.
It performs even worse. The reason is that the bounding rectangle is
bigger and more inaccurate, thus it leads to more recursions (when it
was doing about 2 million function calls for about 100 cells visible in
the end, I somehow know it is wrong :) ). This should be fixable. The
original renderer uses clipping rects too it seems.
I'm currently digging through dromed dump.
The renderer mentions regions. What are they? It seems they are the key
to success.
If you look carefully, you'll notice there is no recursion. They work
with region list instead.
Also interesting thing is that they mark the outgoing portals, do
something, and then unmark them again.
I'll be off this weekend, and I'll try to summarize the problems in my
head to find a solution.
Bye
Filip
---
PS: This is a short call list I've put together (function -> calls
function): (the renderer calls _portal_traverse_scene to get cell list.
Then it sorts the cell list using BSP (for software rendering)):
"_explore_portals"->"_r3_start_block";
"_explore_portals"->"_r3_set_clipmode";
"_explore_portals"->"_fprintf";
"_explore_portals"->"_check_surface_visible";
"_explore_portals"->"_PortalGetClipInfo";
"_explore_portals"->"_fprintf";
"_explore_portals"->"_PortalClipFree";
"_explore_portals"->"_add_region";
"_explore_portals"->"_r3_set_clipmode";
"_explore_portals"->"_fprintf";
"_explore_portals"->"_r3_end_block";
"_poly_overlap_2d"->"_r3_clip_polygon";
"_visible_in_cell"->"_PortalClipOverlap";
"_split_object"->"__stdcall _CriticalMsg(x,x,x)";
"_examine_portals"->"_has_portal_to";
"_examine_portals"->"_check_surface_visible";
"_examine_portals"->"_mprintf";
"_setup_cell"->"_r3_set_clipmode";
"_setup_cell"->"_r3_transform_block";
"_setup_cell"->"_examine_portals";
"_free_cell"->"_PortalClipFree";
"_add_region"->"_fprintf";
"_add_region"->"_setup_cell";
"_add_region"->"_compute_portal_z";
"_add_region"->"_compute_water_clut";
"_add_region"->"_compute_portal_z";
"_add_region"->"_PortalClipUnion";
"_add_region"->"_PortalClipFree";
"_add_region"->"_compute_portal_z";
"_add_region"->"_memmove";
"_add_region"->"_mark_outgoing_portals";
"_initialize_first_region"->"_r3_start_block";
"_initialize_first_region"->"_setup_cell";
"_initialize_first_region"->"_DbgReportError";
"_initialize_first_region"->"_mark_outgoing_portals";
"_initialize_first_region"->"_r3_end_block";
"_initialize_first_region"->"_PortalClipRectangle";
"_portal_traverse_scene"->"_initialize_first_region";
"_portal_traverse_scene"->"_select_next_region";
"_portal_traverse_scene"->"_fprintf";
"_portal_traverse_scene"->"_unmark_outgoing_portals";
"_portal_traverse_scene"->"_explore_portals";
"_portal_traverse_scene"->"_fprintf";
"_portal_traverse_scene"->"_mprintf";
"_portal_traverse_scene"->"_mprintf";
|