View Single Post
  #8  
Old 03-25-2012, 10:58 PM
PixelEngineer
Sarnak
 
Join Date: May 2011
Posts: 96
Default

Quote:
Originally Posted by ableard View Post
Update!!!
I have modified the code to display the entire zone!

The dislpayable regions is hard wired by the wld decryption by way of veiwable regions from each region.
The above gluperspective is true, you can move out as far as you want but the displayable world reaches a maximum, my system it was 2000.

Except!

I modified the code inside 0x22 to compile a new list of viewable "regions" for each region to see ALL regions. Shazam the entire zone gets loaded and viewed. I have written the code to read in all veiwable regions as the WLD is loaded in, so if there is a zone with funny regions they are no displayed. The orignial code also checks for compatability with region and mesh not sure if this is required.

I have used eastkarana/westkarana as my test and they work great. My video card has tons of memory so frame rates are unchanged. I actually suspect with some additional work we can load all four Karana files as one (ie corrdinate transformations required, maybe scaling).

Since your reworking your client, I will add my modifications after you are complete. Load times become longer as expected. I suspect with some work I can improve or improvise a faster way to load.
Cheers!
I am very confused. Lantern will only display the regions that are in the current zone's PVS. The PVS is a list of region's that you can see from your current region. This is to cut down on processing time and thus, framerate. The fact that the whole zone does not render at once is not a bug, it is how the original client worked.

The render function (although rewritten since) does work in the same way.

Here's the process.

1. Where is the camera? Iterate through the BSP tree until the current BSP region is found.

2. What can we see from this region? The vector visibility has the list of all of the regions you can see from the camera's region.

3. What regions can the camera see? The visibility vector is used again and the regions min/max values are checked against the camera's frustum. So only regions that are in the PVS and the camera's frustum will actually be rendered.

Now there is a special case where the camera is outside of any region. This would mean there is no PVS and thus no visible regions but then you couldn't see where you are. Therefore, there is a second function renderWholeZone in the WLD class. This will render the entire zone regardless of where you are.

In the Greater Faydark for example, what you are seeing might be regions "popping" up in the distance but you would never see those based on the clip plane of the zone and the fog. Lantern renders the zones using the same method.

If you want to force it to render the whole zone regardless, just change the render function in main.cpp:

From

Code:
   // Render if we in a region -- else render the whole zone
    if(!outside)
    {
                // If we are in a region, render every region in its PVS and frustum
                zone.renderNew(cameraRegion, cfrustum);
    }
    else
    {
                // We are not in a region, render the whole zone
                zone.renderWholeZone(cfrustum);
    }
to just:

Code:
zone.renderWholeZone(cfrustum);

Hope this helps alleviate confusion.

Cheers!
Reply With Quote