It may be another day before I get the culling system in. I'll try and squeeze it in tonight while my NGC tests run though. My backlog keeps growing and growing lol. Perhaps I should just stay in my cave for a couple of weeks and do nothing but this engine and NGC test.
But Then I would have way too much to do when I got back.
[edit] Uploading the new engine with limb culling now. The fps go up to 100 in places if you compile in window mode. It is not optimized and the fps jumps up and down alot. I am still working on this. You can select the culling modes by the key 1-4. I would only use sphere for now as box and cube is too slow without optimizing. This is just hard limb by limb culling.
[edit2] Link to new version. Sorry it's another full download, I'm too sleepy to sort through it and see what is new and what is not.
[WARNING!!! Do not try to compile the code without renamming/ backing up the example.exe as I forgot to rename the compile exe name and it will be erased.]
See first post for latest download
I am also not exactly sure what I added in this version other than the culling. You can look at the readmes and entity files for most of it though and fall back on the code and opening the map in cshop. Most of this was done while very sleepy and doing other things, so something may not be perfect. Though it appears to all work.
[edit3] The no culling option (key 4) is broken lol. I just thought about it in my sleep
The fix for those who can compile it is to find and replace this section of code:
`****************************************************************************
`****************************************************************************
if keystate(2) = 1
cullmode = 1
endif
if keystate(3) = 1
cullmode = 2
endif
if keystate(4) = 1
cullmode = 3
endif
if keystate(5) = 1
cullmode = 0
endif
begtimecull# = hitimer(10000)
resultcheck# = 0
gosub Extractfrustum
`check each object setup for culling
for j = 1 to NumCullObjs
xculloffset# = object position x(Limb_Info(j, 0).Objnum)
yculloffset# = object position y(Limb_Info(j, 0).Objnum)
zculloffset# = object position z(Limb_Info(j, 0).Objnum)
`test each limb against the frustum (you would use an octree to cut down
`the cheks)
`CurrObj = Limb_Info(Limb_Info(j, 0).Objnum
for i = 0 to Limb_Info(j, 0).NumLimbs
if cullmode > 0
select cullmode
case 1
resultcheck# = SphereInfrustum( Limb_Info(j, i).Xpos + xculloffset#, Limb_Info(j, i).Ypos + yculloffset#, Limb_Info(j, i).Zpos + zculloffset#, Limb_Info(j, i).Spheresize )
endcase
case 2
resultcheck# = CubeInfrustum( Limb_Info(j, i).Xpos + xculloffset#, Limb_Info(j, i).Ypos + yculloffset#, Limb_Info(j, i).Zpos + zculloffset#, Limb_Info(j, i).Cubesize )
endcase
case 3
resultcheck# = BoxInfrustum( Limb_Info(j, i).Xpos + xculloffset#, Limb_Info(j, i).Ypos + yculloffset#, Limb_Info(j, i).Zpos + zculloffset#, Limb_Info(j, i).BoxXsize, Limb_Info(j, i).BoxYsize, Limb_Info(j, i).BoxZsize )
endcase
endselect
if resultcheck# > 0
if limb visible(Limb_Info(j, 0).Objnum,i) = 0
show limb Limb_Info(j, 0).Objnum, i
endif
else
if limb visible(Limb_Info(j, 0).Objnum,i) = 1
hide limb Limb_Info(j, 0).Objnum, i
endif
endif
else
if limb visible(Limb_Info(j, 0).Objnum,i) = 0
show limb Limb_Info(j, 0).Objnum, i
endif
endif
next i
next j
endculltime# = hitimer(10000) - begtimecull#
`****************************************************************************
`****************************************************************************
I'll upload a new exe for those who can't when I wake up. Back to bed I go.