Ok Inferno, put the kettle on...
I have an idea, but it'd take a looooooong time to calculate the visibility.
You firstly need to break your level model into smaller limbs. For example, each wall should be a limb, any part that is high poly should be cut up too - you have to think in segments, you could just base it on a grid, but once you know how it works you'll come up with a good system. It's important, but not important at the same time - because a badly cut up level will be slower, a nicely cut up level will be faster.
Now you need to load the model into DBPro and decide on a bounding box, the whole entire range that the camera can be - like a huge glass box around the level. You'll need an array to stores some variables for each limb in your model, basically the limb bounding sizes, and the visible state - if you were feeling flash you could hijack the system for triggers, limb specific effects like pixel shaders too, you'd simply have more arrays and build the functionality into your portal renderer.
Now for every limb, you need to calculate the visibility box so you can store the data in the array. I suggest being anal with the arrays and storing the XYZ coordinates of 2 opposite box corners - this is enough to get cracking.
This is perhaps the slowest thing ever, but what you do is you position the camera inside the level bounding box, in all possible locations - you can move in blocks, but your basically trying to eek out each limbs own bounding box by checking every possible location with the camera pointed at the limb the whole time.
So assuming your level is inside a 100x100x100 box, your code might look a little like (psuedo code of course):
global limbsinlevel
`Lets pretend theres 100 limbs in your level
limbsinlevel=100
dim limb_x(limbsinlevel,1)
dim limb_y(limbsinlevel,1)
dim limb_z(limbsinlevel,1)
For bx=0 to 100
For by=0 to 100
For bz=0 to 100
position camera bx,by,bz
for limb=1 to limbsinlevel
point camera limb position x(1,limb),limb position y(1,limb),limb position z(1,limb)
hide limb 1,limb
sync
`Grab colour in center of screen
col1=point(320,240)
show limb 1,limb
sync
col2=point(320,240)
`Check 2 colours for a difference (meaning the limb is visible)
if col1<>col2
` Stretch out the bounding box if the limb is visible
if bx<limb_x(limb,0) then limb_x(limb,0)=bx
if bx>limb_x(limb,1) then limb_x(limb,1)=bx
if by<limb_y(limb,0) then limb_y(limb,0)=bx
if by>limb_y(limb,1) then limb_y(limb,1)=bx
if bz<limb_z(limb,0) then limb_z(limb,0)=bx
if bz>limb_z(limb,1) then limb_z(limb,1)=bx
endif
next limb
next bz
bext by
next bx
Do
rotate camera mousey(),mousex(),0
if mouseclick()=1 then move camera 1
camx#=camera position x()
camy#=camera position y()
camz#=camera position z()
portal(camx#,camy#,camz#)
Sync
Loop
function portal(x#,y#,z#)
for limb=1 to limbsinlevel
hide limb 1,limb
if x#>bx(limb,0) and x#<bx(limb,1)
if y#>by(limb,0) and y#<by(limb,1)
if z#>bz(limb,0) and z#<bz(limb,1)
show limb 1,limb
endif
endif
endif
next limb
endfunction
Hope this sheds a little light.
Van-B
My cats breath smells of cat food.