Use this code:
http://www.blitzbasic.com/codearcs/codearcs.php?code=815
I just added it to the code archives. It was a system I was working on for speeding up the rendering of distant objects. I'm pretty sure that's why Zelda does what it does. I found though that at least in Blitz, there is little benefit to this method since you cannot render to a texture directly (the copy operation takes some time) the blurring operation takes some time, (no direct hardware blur, which the gamecube probably has) and even if you solve those problems, without the ability to render images with alpha, you can't optimize it by rendering the stuff that's farther away less often than the stuff that's nearby, which I'm sure is another optimization they're doing in Zelda.
But luckilly for you that doesn't matter if all you want is for stuff to be blurry when it's far away. And this code is really simple to use. You'll have to have a sky which is large enough to encompass your world (no render order tricks) and then you just specify the distance to which your main camera renders with the far clipping plane and everything beyond that is rendered with the special camera and then a skybox is generated.
You may or may not be able to speed things up by rendering only one view instead of six but rendering it every frame and placing that on a plane in front of the camera instead of rendering a skybox. The advantage rendering a skybox provides is that you can turn around in one spot with no cost at all once the maps are rendered, and you can move around a bit without having to have the maps rerendered.
You could also speed up the algorithm by creating "nodes" around the player and attempting to render skyboxes from the node which the player is moving towards over the course of several frames to get rid of the jittering from the sudden rendering of six images. That way you could render just one of the six images each frame till they get to the new node and then swap in the new node's textures when they get there.
|