How to enable CEL super clipping
A very basic feature that for some reason is disabled by default, is that of additional CEL clipping hardware functions. The 3DO will clip the rendering against the framebuffer (or a smaller clipping area if you define it with certain functions) so pixels will never be rendered outside the screen and corrupt memory. However, it does so by continuing the costly interpolation and checking pixel after pixel, finally discarding the rendering of it if it falls out of screen borders. This is called Normal Clipping in the documentation.
But little did I know as I was coding some homebrew stuff that very big CEL quads that fall partially or fully outside the screen, like a 3D stars zooming effect with big blobs would sometimes sharply drop down the frame rate as some of the stars came too close even if they were projected outside of the screen (and I was lazy to check that with the CPU back then). By the time I managed to enable the super clipping functionality, everything became much smoother with an always stable 60fps framerate.
I found a similar lack of this feature even in commercial games like Doom on the 3DO. In most cases of course, because of the performance bottleneck on the CPU, enabling this feature wouldn't give much. Except when the player moved extremely close to some very tall walls. The wall columns weren't clipped against the vertical borders of the screen to avoid more CPU calculations, only left for the 3DO hardware to clip the rendering. By enabling this feature, moving close to the tall walls would saw a big difference. I made an experimental map with the highest wall height I could do (a bit less than 1024 I think, as this would hit the maximum CEL bitmap width) and going close to this wall would yield 5fps without superclipping and maybe reach 30fps or more with it (I don't remember the exact numbers, but I remember the low 5fps and the vast difference). Of course not very useful for the majority of player views that hit the bottleneck, but a very easy feature to have that many 3DO programmers might miss.
And they might miss the feature as I initially did, because unlike other CEL features that can be enabled by simply setting some flags on your CCB structure, this one needs one additional step.
You have to set after screen initialization the ASCALL flags in the CEL engine control. Below I am doing it for each of my two bitmap items created for double buffering.
for (i=0; i<2; ++i) {
SetCEControl(BitmapItems[i], 0xffffffff, ASCALL);
}
And only now it will work when you enable the bit flags in all of your CCBs.
Comments
Post a Comment