Sometimes can not see objects

Randywang

21-10-2009 08:28:56

Hello!
Recently,I encounter a problem in using the pczsm.
I use the pczsm to load terrains. There are 12 terrains that are sequential and some other objects.

As long as I load the 12th terrain which is the last terrain, there are some objects that can not be seen. If I don't load the 12th terrain and load other terrains, objects, etc, there is no problem.

So what's the problem? I have worked several days to find out , but failed!

Please ,please, please help me! :(

Lf3THn4D

22-10-2009 11:20:22

Hi, it would be difficult to tell what went wrong without more information.
Some screenshot showing the problem would be good.

Also how are you loading up the terrains? All in one zone? Or each terrain in it's own zone? Are you using AABB portal or the normal portal plane?

crazii

23-10-2009 05:11:33

I'm afriad there not enough details about your problem.I wish more informations.
I bet if you put all terrain in one zone,there's no problem.:D

Randywang

24-10-2009 11:52:34

I'm so sorry.
There are 12 terrains. Each terrain is in a different zone. And there are bridges and roads, these are in the default zone.
If I load the first 11 terrains and don't load the 12th terrain, there is no prolem.
The pic:
[attachment=1]hasroad.JPG[/attachment]
But if I load the 12th terrain.The roads can't see.
The pic:
[attachment=0]noroad.JPG[/attachment]
The two Screenshot are in the same position.
At the first I think it's the portal cause the problem. But when I set the portal to infinite,the result is the same.
So what's the problem, The terrains are sequential, form 1 to 12.
The terrain's total config file are:{Num,x coordinate offset,z coordinte offset,zone name,terrain config file name}
1
0
0
terrain1_Zone
terrain1.cfg
2
-4570
6380
terrain2_Zone
terrain2.cfg
3
-4600
11370
terrain3_Zone
terrain3.cfg
4
-7710
17360
terrain4_Zone
terrain4.cfg
5
-15110
20720
terrain5_Zone
terrain5.cfg
6
-18980
25330
terrain6_Zone
terrain6.cfg
7
-21460
28980
terrain7_Zone
terrain7.cfg
8
-22670
32520
terrain8_Zone
terrain8.cfg
9
-32910
32520
terrain9_Zone
terrain9.cfg
10
-39710
39880
terrain10_Zone
terrain10.cfg
11
-46600
46570
terrain11_Zone
terrain11.cfg
12
-52900
52980
terrain12_Zone
terrain12.cfg

Lf3THn4D

26-10-2009 09:36:32

Have you tried loading only the last terrain and see if it has the same problem?
As far as I can see, there shouldn't be any issue.

Aside from this, I'm not exactly sure what you are trying to do. But the way you are using PCZSceneManager right now doesn't make sense. It might be better for you to use the default octree SM if you are only dealing with an open terrain of a fixed size.

Randywang

27-10-2009 02:28:10

Have you tried loading only the last terrain and see if it has the same problem?
As far as I can see, there shouldn't be any issue.

Aside from this, I'm not exactly sure what you are trying to do. But the way you are using PCZSceneManager right now doesn't make sense. It might be better for you to use the default octree SM if you are only dealing with an open terrain of a fixed size.


Hi,I tried that. If I load 12th,11th,10th terrains, I can see the road in the 12th terrain,but I can't see the road in the other terrains. If I load any of them except the 12th terrain there isn't that problem,(for example,load the 9th,10th,11th,there is no problem). As long as I load the 12th terrain, that question arises.
So strange! :?

yes,using PCZSceneManager right now doesn't make sense.But I cann't find one SM to laod more than one terrains except the PCZSM. And the efficiency is exactly higher than the other SM in rendering large terrain.

And as I know, only the PCZSM can set the offset of the terrain. The other SM only have the setWorldGeometry function that makes the terrain's intial coordinte at (0,0). Maybe my knowledge is poor.

Lf3THn4D

27-10-2009 02:46:06

Are you using the latest build from the repository? Or is this the Shoggoth release? If you are not using trunk, you might want to try that and see if latest code fixes your problem.

Aside from that, you are misusing PCZSM. The idea of PCZSM is to zone objects up so that culling will be efficient. So if you want to zone it by terrain, your roads should also be segmented and placed within the terrain's zone.

But you seem to want huge terrain that extends in a single direction. I believe the latest code on paging terrain should fit better for your case.
http://www.ogre3d.org/forums/viewtopic.php?f=11&t=50674

Randywang

27-10-2009 08:55:03

Are you using the latest build from the repository? Or is this the Shoggoth release? If you are not using trunk, you might want to try that and see if latest code fixes your problem.

Aside from that, you are misusing PCZSM. The idea of PCZSM is to zone objects up so that culling will be efficient. So if you want to zone it by terrain, your roads should also be segmented and placed within the terrain's zone.


Thank you!
I build the source 1.6.2 from the repository. And I modify the PCZSM source to resolve the problem "I'm trying to delete a zone..http://www.ogre3d.org/addonforums/viewtopic.php?f=22&t=8890 ".

I will try to use the latest code from the trunk.

Yes,you are right! I misuse PCZSM. I should segment the road and placed within the terrain's zone. But the road is diffcult to segment. So I just haven't done that. I just want to use the PCASM to load several terrains(there is a relative offset between each terrains) at one time. Is there some other SM can do that job???

Due to the terrains are too many that I cann't load tham totally(Memory will leak and the effiency is so slow). So I have to load/unload them dynamicly.

Lf3THn4D

27-10-2009 09:51:00

Aha! Then the latest paging system is your friend. Look under Components of Trunk source. My previous link (http://www.ogre3d.org/forums/viewtopic.php?f=11&t=50674) is the new terrain system that uses the new paging feature. However, do keep in mind that this is still very new (meaning to say that there's bound to be bugs and unimplemented features). But it's definitely what you want. It does paging of resources in a sub thread so you can still simulate the world while things are loading/unloading.

The PCZSM as of now has a bug with zone unloading as you have pointed out in your link. It is still not fixed yet. I do intend to have a look into fixing it. But right now I've yet to find the time for it. If you have resolved that issue, would be good to submit a patch. ;)

Randywang

28-10-2009 07:14:09

Hi,Thanks for your suggestions. I have built the latest trunk and will try to use that. Maybe it will cost my several days.

The PCZSM as of now has a bug with zone unloading as you have pointed out in your link. It is still not fixed yet. I do intend to have a look into fixing it. But right now I've yet to find the time for it. If you have resolved that issue, would be good to submit a patch.

I have to say that I'm a novice. I have not understood the PCZSM completely. So my solution looks inefficiency. Maybe it has some bugs. But so far I have not found. I have created and destroyed the same name zone for many times. I just add two functions to iterator all the sceneNodes and delete the zoneData in the sceneNode.

void PCZSceneManager::delZoneSpecificNodeData(Ogre::String & zoneName)
{
SceneNodeList::iterator it=mSceneNodes.begin();
PCZSceneNode * pczsn;
while(it!=mSceneNodes.end())
{
pczsn=(PCZSceneNode*)(it->second);
pczsn->delZoneData(zoneName);
it++;
}
}

void PCZSceneNode::delZoneData(Ogre::String & zoneName)
{
ZoneDataMap::iterator it =mZoneData.find(zoneName);
if(it!= mZoneData.end())
{
ZoneData* zoneData=it->second;
OGRE_DELETE zoneData;
mZoneData.erase(zoneName);
}
}