Discussion:
[Crystal-develop] Help with assertion bug
Ralph Campbell
2014-01-06 02:32:43 UTC
Permalink
I'm trying to debug a problem with PlaneShift and Crystalspace.
I configured CS --enable-debug and ran PS.
You can see in the trace below, there is an assertion when a portal
is created. The assertion is due to the csPortalContainer bounding
box being uninitialized which makes sense since the csPortalContainer
is created and then the portal vertices are added.
I'm not sure what the correct fix would be.
Any help is appreciated.


Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000039adc0ee6b in raise (sig=5)
at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
37 return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
(gdb) bt
#0 0x00000039adc0ee6b in raise (sig=5)
at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1 0x00007ffff778895e in CS::Debug::DebugBreak () at ./include/cssysdef.h:971
#2 0x00007ffff7788bce in CS::Debug::AssertMessage (
expr=0x7fff9b6ef169 "min <= max",
filename=0x7fff9b6eed70 "./include/csgeom/spatialtree.h", line=752,
msg=0x0) at /devel/ralphc/CS_LATEST/libs/csutil/csassert.cpp:82
#3 0x00007fff9b6df748 in CS::Geometry::SpatialTree<CS::Geometry::KDTree<CS::Geometry::SpatialTreeChild::BoxChild<true> >, CS::Geometry::SpatialTreeChild::BoxChild<true> >::AddObject (this=0x7fffd18b2598, bounds=..., object=0x7fffc925d8a0)
at ./include/csgeom/spatialtree.h:752
#4 0x00007fff9b6da1b7 in csFrustumVis::RegisterVisObject (
this=0x7fff9947e950, visobj=0x7fff9947ec08)
at /devel/ralphc/CS_LATEST/plugins/culling/frustvis/frustvis.cpp:317
#5 0x00007fffe9cba4db in csSector::RegisterMeshToCuller (this=0x7fffc919f6a0,
mesh=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:215
#6 0x00007fffe9cba606 in csSector::PrepareMesh (this=0x7fffc919f6a0,
mesh=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:230
#7 0x00007fffe9cb8de0 in csSectorMeshList::PrepareMesh (this=0x7fffc919f738,
item=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:59
#8 0x00007fffe9c0dbdc in CS::Plugin::Engine::csMeshList::Add (
this=0x7fffc919f738, obj=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:1268
#9 0x00007fffe9c09db5 in CS::Plugin::Engine::csMeshWrapper::MoveToSector (
this=0x7fff9947eba0, s=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:375
#10 0x00007fffe9cba2ac in csSector::PrepareMovable (this=0x7fffc919f6a0,
movable=0x7fff9947ec80)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:184
#11 0x00007ffff78e7973 in CS::Engine::MovableSectorList::PrepareSector (
this=0x7fff9947ecf0, sector=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:49
#12 0x00007ffff78e85b9 in CS::Engine::BaseMovable::SetSector (
this=0x7fff9947ec68, sector=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:156
#13 0x00007fffe9c82720 in csEngine::CreateMeshWrapper (this=0x7fffec8ee4f8,
mesh=0x7fffa2efc0c0, name=0x7fffa47f3c48 "_p_npcroom",
sector=0x7fffc919f700, pos=..., addToList=true)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:3008
#14 0x00007fffe9c81d24 in csEngine::CreatePortalContainer (
this=0x7fffec8ee4f8, name=0x7fffa47f3c48 "_p_npcroom",
sector=0x7fffc919f700, pos=...)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2895
---Type <return> to continue, or q <return> to quit---
#15 0x00007fffe9c8234e in csEngine::CreatePortal (this=0x7fffec8ee4f8,
name=0x7fffa47f3c48 "_p_npcroom", sourceSector=0x7fffc919f700, pos=...,
destSector=0x0, vertices=0x7fffa5a8d220, num_vertices=4, portal=
@0x7fffa4778bc8: 0xcacacacacacacaca)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2966
#16 0x00007fffe7d380e9 in CS::Plugin::bgLoader::BgLoader::Portal::LoadObject (
this=0x7fffa4778a28) at src/plugins/common/bgloader/loader_objects.cpp:385
#17 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa4778a28, wait=false)
at src/plugins/common/bgloader/loader.h:547
#18 0x00007fffe7d3c5c7 in CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Portal>::LoadObjects (this=0x7fffa478fb08, wait=false)
at src/plugins/common/bgloader/loader.h:953
#19 0x00007fffe7d38a2f in CS::Plugin::bgLoader::BgLoader::Sector::LoadObject (
this=0x7fffa478f980, wait=false)
at src/plugins/common/bgloader/loader_objects.cpp:482
#20 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa478f980, wait=false)
at src/plugins/common/bgloader/loader.h:547
#21 0x00007fffe7d52895 in CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Sector>::LoadObjects (this=0x7fffa478b6e8, wait=false)
at src/plugins/common/bgloader/loader.h:953
#22 0x00007fffe7d4933c in CS::Plugin::bgLoader::BgLoader::Zone::LoadObject (
this=0x7fffa478b640, wait=false)
at src/plugins/common/bgloader/loader.h:1665
#23 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa478b640, wait=false)
at src/plugins/common/bgloader/loader.h:547
#24 0x00007fffe7d1b761 in CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Zone>::LoadObjects (this=0x7fffe8bbd3f8, wait=false)
at src/plugins/common/bgloader/loader.h:953
#25 0x00007fffe7d1212e in CS::Plugin::bgLoader::BgLoader::LoadZones (
this=0x7fffe8bbc540, regions=0x7fffd174c070, priority=false)
at src/plugins/common/bgloader/loader.cpp:233
#26 0x000000000042f544 in ZoneHandler::LoadZone (this=0x13f00c0, pos=...,
yrot=0, sector=0x7fffffffd6b8 "NPCroom", vel=..., force=false)
at src/client/zonehandler.cpp:238
#27 0x000000000042f293 in ZoneHandler::HandleMessage (this=0x13f00c0,
me=0x12a7dd0) at src/client/zonehandler.cpp:206
#28 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
this=0x13f00c0, msg=0x12a7dd0) at ./src/common/net/cmdbase.h:73
#29 0x0000000000619172 in MsgHandler::Publish (this=0x126a780, me=0x12a7dd0)
at src/common/net/msghandler.cpp:76
#30 0x00000000004568e2 in psCelClient::HandleWorld (this=0x13ef7a0,
me=0x7fff80000f00) at src/client/pscelclient.cpp:237
#31 0x000000000045a69e in psCelClient::HandleMessage (this=0x13ef7a0,
---Type <return> to continue, or q <return> to quit---
me=0x7fff80000f00) at src/client/pscelclient.cpp:823
#32 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
this=0x13ef7a0, msg=0x7fff80000f00) at ./src/common/net/cmdbase.h:73
#33 0x0000000000619172 in MsgHandler::Publish (this=0x126a780,
me=0x7fff80000f00) at src/common/net/msghandler.cpp:76
#34 0x00000000005db225 in ClientMsgHandler::DispatchQueue (this=0x126a780)
at src/common/net/clientmsghandler.cpp:93
#35 0x00000000005db1c8 in ClientMsgHandler::HandleEvent (this=0x126a780)
at src/common/net/clientmsghandler.cpp:76
#36 0x00000000005daac3 in ClientMsgHandler::EventHandler::HandleEvent (
this=0x7fffd187f2f0, event=...) at ./src/common/net/clientmsghandler.h:73
#37 0x00007ffff77dca01 in csEventTree::Dispatch (this=0xafb530, e=...)
at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:576
#38 0x00007ffff77dc8e7 in csEventTree::Notify (this=0xafb530)
at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:546
#39 0x00007ffff776f25d in csEventQueue::Notify (this=0x7ffff0fa6690, name=...)
at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:239
#40 0x00007ffff776f350 in csEventQueue::Process (this=0x7ffff0fa6690)
at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:255
#41 0x00007ffff77fe673 in csDefaultRunLoop (r=0x7ffff0f87e78)
at /devel/ralphc/CS_LATEST/libs/csutil/generic/runloop.cpp:99
#42 0x00000000004ab4ff in main (argc=1, argv=0x7fffffffdf98)
at src/client/psengine.cpp:1993
Matthieu Kraus
2014-01-06 07:21:22 UTC
Permalink
Greetings,

For now you may safely ignore the assert.

The reason this asserts is that SpatialTree does loads of sanity
checks in debug mode,
one of them being checking for valid objects on insertion. Accordingly
this fails as
the object shouldn't be added as it isn't a valid object at all. Now
this is fine as long
as the object is valid by the time it's distributed in the tree which
is probably the case
for you, however it still triggers that assertion on insertion as it's
easier to track things
down that way.

I'll dig around a bit, but the proper fix to that assertion firing for
you should probably
be to not not prepare meshes upon creation as preparing registers them
to the culler which
isn't exactly a sane operation on an empty mesh. Alternatively
occluvis could detect that
and not insert such objects at this point - might be worth checking
with frustvis and dynavis
whether they handle this gracefully or not.

kind regards,
RlyDontKnow
Post by Ralph Campbell
I'm trying to debug a problem with PlaneShift and Crystalspace.
I configured CS --enable-debug and ran PS.
You can see in the trace below, there is an assertion when a portal
is created. The assertion is due to the csPortalContainer bounding
box being uninitialized which makes sense since the csPortalContainer
is created and then the portal vertices are added.
I'm not sure what the correct fix would be.
Any help is appreciated.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000039adc0ee6b in raise (sig=5)
at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
37 return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
(gdb) bt
#0 0x00000039adc0ee6b in raise (sig=5)
at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1 0x00007ffff778895e in CS::Debug::DebugBreak () at
./include/cssysdef.h:971
#2 0x00007ffff7788bce in CS::Debug::AssertMessage (
expr=0x7fff9b6ef169 "min <= max",
filename=0x7fff9b6eed70 "./include/csgeom/spatialtree.h", line=752,
msg=0x0) at /devel/ralphc/CS_LATEST/libs/csutil/csassert.cpp:82
#3 0x00007fff9b6df748 in
CS::Geometry::SpatialTree<CS::Geometry::KDTree<CS::Geometry::SpatialTreeChild::BoxChild<true> >, CS::Geometry::SpatialTreeChild::BoxChild<true> >::AddObject (this=0x7fffd18b2598, bounds=...,
object=0x7fffc925d8a0)
at ./include/csgeom/spatialtree.h:752
#4 0x00007fff9b6da1b7 in csFrustumVis::RegisterVisObject (
this=0x7fff9947e950, visobj=0x7fff9947ec08)
at /devel/ralphc/CS_LATEST/plugins/culling/frustvis/frustvis.cpp:317
#5 0x00007fffe9cba4db in csSector::RegisterMeshToCuller
(this=0x7fffc919f6a0,
mesh=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:215
#6 0x00007fffe9cba606 in csSector::PrepareMesh (this=0x7fffc919f6a0,
mesh=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:230
#7 0x00007fffe9cb8de0 in csSectorMeshList::PrepareMesh (this=0x7fffc919f738,
item=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:59
#8 0x00007fffe9c0dbdc in CS::Plugin::Engine::csMeshList::Add (
this=0x7fffc919f738, obj=0x7fff9947ec00)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:1268
#9 0x00007fffe9c09db5 in CS::Plugin::Engine::csMeshWrapper::MoveToSector (
this=0x7fff9947eba0, s=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:375
#10 0x00007fffe9cba2ac in csSector::PrepareMovable (this=0x7fffc919f6a0,
movable=0x7fff9947ec80)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:184
#11 0x00007ffff78e7973 in CS::Engine::MovableSectorList::PrepareSector (
this=0x7fff9947ecf0, sector=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:49
#12 0x00007ffff78e85b9 in CS::Engine::BaseMovable::SetSector (
this=0x7fff9947ec68, sector=0x7fffc919f700)
at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:156
#13 0x00007fffe9c82720 in csEngine::CreateMeshWrapper (this=0x7fffec8ee4f8,
mesh=0x7fffa2efc0c0, name=0x7fffa47f3c48 "_p_npcroom",
sector=0x7fffc919f700, pos=..., addToList=true)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:3008
#14 0x00007fffe9c81d24 in csEngine::CreatePortalContainer (
this=0x7fffec8ee4f8, name=0x7fffa47f3c48 "_p_npcroom",
sector=0x7fffc919f700, pos=...)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2895
---Type <return> to continue, or q <return> to quit---
#15 0x00007fffe9c8234e in csEngine::CreatePortal (this=0x7fffec8ee4f8,
name=0x7fffa47f3c48 "_p_npcroom", sourceSector=0x7fffc919f700, pos=...,
destSector=0x0, vertices=0x7fffa5a8d220, num_vertices=4, portal=
@0x7fffa4778bc8: 0xcacacacacacacaca)
at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2966
#16 0x00007fffe7d380e9 in
CS::Plugin::bgLoader::BgLoader::Portal::LoadObject (
this=0x7fffa4778a28) at
src/plugins/common/bgloader/loader_objects.cpp:385
#17 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa4778a28, wait=false)
at src/plugins/common/bgloader/loader.h:547
#18 0x00007fffe7d3c5c7 in
CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Portal>::LoadObjects (this=0x7fffa478fb08,
wait=false)
at src/plugins/common/bgloader/loader.h:953
#19 0x00007fffe7d38a2f in
CS::Plugin::bgLoader::BgLoader::Sector::LoadObject (
this=0x7fffa478f980, wait=false)
at src/plugins/common/bgloader/loader_objects.cpp:482
#20 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa478f980, wait=false)
at src/plugins/common/bgloader/loader.h:547
#21 0x00007fffe7d52895 in
CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Sector>::LoadObjects (this=0x7fffa478b6e8,
wait=false)
at src/plugins/common/bgloader/loader.h:953
#22 0x00007fffe7d4933c in CS::Plugin::bgLoader::BgLoader::Zone::LoadObject (
this=0x7fffa478b640, wait=false)
at src/plugins/common/bgloader/loader.h:1665
#23 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
this=0x7fffa478b640, wait=false)
at src/plugins/common/bgloader/loader.h:547
#24 0x00007fffe7d1b761 in
CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Zone>::LoadObjects (this=0x7fffe8bbd3f8,
wait=false)
at src/plugins/common/bgloader/loader.h:953
#25 0x00007fffe7d1212e in CS::Plugin::bgLoader::BgLoader::LoadZones (
this=0x7fffe8bbc540, regions=0x7fffd174c070, priority=false)
at src/plugins/common/bgloader/loader.cpp:233
#26 0x000000000042f544 in ZoneHandler::LoadZone (this=0x13f00c0, pos=...,
yrot=0, sector=0x7fffffffd6b8 "NPCroom", vel=..., force=false)
at src/client/zonehandler.cpp:238
#27 0x000000000042f293 in ZoneHandler::HandleMessage (this=0x13f00c0,
me=0x12a7dd0) at src/client/zonehandler.cpp:206
#28 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
this=0x13f00c0, msg=0x12a7dd0) at ./src/common/net/cmdbase.h:73
#29 0x0000000000619172 in MsgHandler::Publish (this=0x126a780, me=0x12a7dd0)
at src/common/net/msghandler.cpp:76
#30 0x00000000004568e2 in psCelClient::HandleWorld (this=0x13ef7a0,
me=0x7fff80000f00) at src/client/pscelclient.cpp:237
#31 0x000000000045a69e in psCelClient::HandleMessage (this=0x13ef7a0,
---Type <return> to continue, or q <return> to quit---
me=0x7fff80000f00) at src/client/pscelclient.cpp:823
#32 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
this=0x13ef7a0, msg=0x7fff80000f00) at ./src/common/net/cmdbase.h:73
#33 0x0000000000619172 in MsgHandler::Publish (this=0x126a780,
me=0x7fff80000f00) at src/common/net/msghandler.cpp:76
#34 0x00000000005db225 in ClientMsgHandler::DispatchQueue (this=0x126a780)
at src/common/net/clientmsghandler.cpp:93
#35 0x00000000005db1c8 in ClientMsgHandler::HandleEvent (this=0x126a780)
at src/common/net/clientmsghandler.cpp:76
#36 0x00000000005daac3 in ClientMsgHandler::EventHandler::HandleEvent (
this=0x7fffd187f2f0, event=...) at ./src/common/net/clientmsghandler.h:73
#37 0x00007ffff77dca01 in csEventTree::Dispatch (this=0xafb530, e=...)
at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:576
#38 0x00007ffff77dc8e7 in csEventTree::Notify (this=0xafb530)
at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:546
#39 0x00007ffff776f25d in csEventQueue::Notify (this=0x7ffff0fa6690, name=...)
at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:239
#40 0x00007ffff776f350 in csEventQueue::Process (this=0x7ffff0fa6690)
at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:255
#41 0x00007ffff77fe673 in csDefaultRunLoop (r=0x7ffff0f87e78)
at /devel/ralphc/CS_LATEST/libs/csutil/generic/runloop.cpp:99
#42 0x00000000004ab4ff in main (argc=1, argv=0x7fffffffdf98)
at src/client/psengine.cpp:1993
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Crystal-develop mailing list
https://lists.sourceforge.net/lists/listinfo/crystal-develop
Matthieu Kraus
2014-01-09 13:10:17 UTC
Permalink
Greetings,

after researching Ralph's issue with CreatePortal a bit I recognized
that csEngine::CreatePortal sets the sector of the mesh (and
accordingly prepares it for rendering and by extension for culling)
prior to adding any vertices, i.e. it prepares a mesh without any
vertices for rendering. As this doesn't seem valid to me at all, I'd
like to change CreatePortal accordingly to set the sector/pos after
being done creating the portal to prevent this from occuring. However
the current signature of CreatePortalContainer (which is also exposed
by iEngine) suggests that it should be fine to create and prepare such
an invalid mesh.

Accordingly I'd like to remove the sector and pos arguments for
CreatePortalContainer and add a note that the user is responsible for
setting the position and sector after being done creating the portals
belonging to that container and that doing so without a valid portal
in the container may result in undefined behaviour.

If anyone has obligations about this way of handling invalid
meshes/bumping iEngine, please let me know.

kind regards,
RlyDontKnow
res
2014-01-09 15:47:16 UTC
Permalink
Hi,
Post by Matthieu Kraus
after researching Ralph's issue with CreatePortal a bit I recognized
that csEngine::CreatePortal sets the sector of the mesh (and
accordingly prepares it for rendering and by extension for culling)
prior to adding any vertices, i.e. it prepares a mesh without any
vertices for rendering. As this doesn't seem valid to me at all,
A mesh without any vertices is an edge case, but it shouldn't really be
an invalid case.

-f.r.
Matthieu Kraus
2014-01-09 16:07:12 UTC
Permalink
Well, it would be an edge case if we had an empty (but valid) bbox for
such meshes located at their position - or well, at least from a
culling point of view, as we could actually test it for visibility
then. However as it stands now it pretty much is invalid, so I'm not
sure what to make out of it.

If there's obligations against starting to forbid using such meshes
the second best I can think of is making the bbox getter return an
empty bbox located at the current position (i.e. origin in object
space) instead of an invalid one, but I'm not sure that's such a good
idea, either.

-RlyDontKnow
Post by res
Hi,
Post by Matthieu Kraus
after researching Ralph's issue with CreatePortal a bit I recognized
that csEngine::CreatePortal sets the sector of the mesh (and
accordingly prepares it for rendering and by extension for culling)
prior to adding any vertices, i.e. it prepares a mesh without any
vertices for rendering. As this doesn't seem valid to me at all,
A mesh without any vertices is an edge case, but it shouldn't really be
an invalid case.
-f.r.
res
2014-01-09 21:56:52 UTC
Permalink
Post by Matthieu Kraus
Well, it would be an edge case if we had an empty (but valid) bbox for
such meshes located at their position - or well, at least from a
culling point of view, as we could actually test it for visibility
then. However as it stands now it pretty much is invalid, so I'm not
sure what to make out of it.
What about skipping culling for meshes returning an invalid (max < min)
or empty meshes? They could simply be treated invisible.

-f.r.
Matthieu Kraus
2014-01-10 08:13:36 UTC
Permalink
Problem is that the cullers don't keep superflous lists of objects,
they just add them to their tree.
Obviously it's not really sane to add an invalid bbox to a spatial
tree (the old kd-tree just gave them some magic bounding box, but I'm
not really in favour of that tbh). So if we don't assume objects are
valid upon Preparing them we'd have to build some kind of "currently
invalid" list in the cullers to manage objects that cannot be culled
and use different callbacks for those or such.

Anyway, given that such meshes are essentially only meshes that are
currently being prepared I don't think that overhead is really worth it.
Post by res
Post by Matthieu Kraus
Well, it would be an edge case if we had an empty (but valid) bbox for
such meshes located at their position - or well, at least from a
culling point of view, as we could actually test it for visibility
then. However as it stands now it pretty much is invalid, so I'm not
sure what to make out of it.
What about skipping culling for meshes returning an invalid (max < min)
or empty meshes? They could simply be treated invisible.
-f.r.
Ralph Campbell
2014-01-10 19:58:28 UTC
Permalink
I committed a change to CreatePortalContainer() which delays registering
the container with the sector until the portal is created and added
to the container. Thus the bounding box is defined.
This lets PlaneShift more or less run.
There are still a number of other problems I'm seeing but I think
they are unrelated.
Post by Matthieu Kraus
Problem is that the cullers don't keep superflous lists of objects,
they just add them to their tree.
Obviously it's not really sane to add an invalid bbox to a spatial
tree (the old kd-tree just gave them some magic bounding box, but I'm
not really in favour of that tbh). So if we don't assume objects are
valid upon Preparing them we'd have to build some kind of "currently
invalid" list in the cullers to manage objects that cannot be culled
and use different callbacks for those or such.
Anyway, given that such meshes are essentially only meshes that are
currently being prepared I don't think that overhead is really worth it.
Post by res
Post by Matthieu Kraus
Well, it would be an edge case if we had an empty (but valid) bbox for
such meshes located at their position - or well, at least from a
culling point of view, as we could actually test it for visibility
then. However as it stands now it pretty much is invalid, so I'm not
sure what to make out of it.
What about skipping culling for meshes returning an invalid (max < min)
or empty meshes? They could simply be treated invisible.
-f.r.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Crystal-develop mailing list
https://lists.sourceforge.net/lists/listinfo/crystal-develop
Loading...