Textures in Outerworlds 3.0 and later

 
One of the many benefits of 3D hardware support is the improved quality of textures ("textures" are the images placed on the surface of many 3D objects in order to make them appear more realistic, such as bricks, wood grain, dirt, plants, etc.). 3D accelerators can improve the handling and appearance of textures in many ways, including:

  • Bilinear filtering - "bilinear filtering" refers to a process where the graphics hardware smooths the appearance of a texture by interpolating from one pixel value to the next. Unlike previous versions of Outerworlds, where textures viewed up close could appear blocky or "pixelated", textures now appear perfectly smooth even if you are viewing them from very close, thanks to bilinear filtering.


  • Mipmaps - while bilinear filtering improves the appearance of textures when viewed from up close, "mipmaps" improve the appearance of textures viewed from far away. The "mip" in mipmap stands for multum in parvo, or "many things in a small place." Think of a mipmap as a lower resolution version of a texture where each pixel contains an average of several pixels from the original version. When displaying a mipmapped texture that is far away, using the lower resolution mipmap produces an image that appears to be a smoother, slightly fuzzier version of the original texture. By comparison, when a non-mipmapped texture is rendered far away, the pixel values chosen from the texture map (by a process known as "point sampling") are typically far apart, giving the texture a blocky, random look which often "shimmers" when your viewpoint is moving. Mipmaps eliminate this effect, at the cost of a slight increase in storage size.

    Mipmaps can be enabled or disabled from the Performance dialog. Object makers can also turn off mipmapping for individual textures using the TextureMipmapState RWX command.



  • Grayscale masks - a texture "mask" is an image that, when applied to the texture, defines which pixels in that texture appear opaque and which appear transparent. For example, the many tree and flower objects in OW world are made using masks. Previous versions of Outerworlds allowed only "monochrome" (or "1-bit") masks, meaning a given pixel in the texture could be made either 100% transparent or 100% opaque. Beginning with 3.0, Outerworlds allows the use of "grayscale" masks, where each pixel in a texture can now be made entirely transparent, entirely opaque, or anywhere in between. The Windows BMP file used for a texture map can be any bit depth, where higher bit depths allow for more subtler degrees of opacity in the mask.

Multiple Texture Sizes

Another texture improvement beginning with 3.0 is that the browser can now support and display a wide range of different texture sizes. Unlike previous versions of Outerworlds, where all textures were limited to a fixed size of 128 x 128 pixels (or 256 x 256 pixels in the "high res" CD version), in 3.0 and later a variety of texture sizes are supported, including 64 x 64, 128 x 128, 256 x 256, and even 512 x 512 (although not all video cards support textures that large). Outerworlds decides what size texture to use based on the size of the JPEG original - the larger the JPEG, the larger the texture. This allows efficient use of texture memory while simultaneously providing access to a very high level of texture detail if and when it is required.

Also, textures no longer need to be square. The only requirement is that the width and height both are a power of two. When a JPEG original is converted to a texture for use in Outerworlds, the width and height for the texture are chosen as the largest power of 2 that is less than or equal to the width and height for the JPEG. For example, a JPEG original that is 300 pixels wide by 200 pixels high would be converted to a texture that is 256 pixels wide by 128 pixels high.

It is very important to note this introduces some new concerns for those who are developing content for Outerworlds 3.0 and later. With previous versions, one did not have to worry too much about the size of the JPEG original for a texture or picture because it was always converted to the same 128 x 128 dimensions regardless, and thus always took up the same amount of memory. But beginning with 3.0, a large JPEG original can wind up taking quite a bit of video memory (always a scarce resource!) because it gets stored in a larger texture. Remember that on most video cards, a single 256 x 256 texture takes up 128K of video RAM, and a single 512 x 512 texture takes half a megabyte! On many older video cards with video memory of 8 megs or less, using a lot of large textures in your world can quickly exhaust available video memory and force the hardware to use main system memory to store the additional textures. This can cause a significant performance hit for your visitors and discourage them from returning to your world.

Another concern to keep in mind is that it is always best to make sure that the dimensions of your JPEG originals are powers of 2 (for example, 128 x 128, 256 x 256, 256 x 128, etc.) While any dimension JPEG will work, JPEGs with dimensions that are not powers of 2 must be internally converted to new dimensions when they are loaded as textures. This conversion is an expensive operation (since the original image must be stretched or compressed and the pixel information resampled and smoothed to fit the new dimensions) which can quickly add up to slow down the browser if a lot of textures in the world need to be converted. The best way to avoid this problem is simply to make sure that your JPEGs originals all have power-of-2 dimensions so they can be translated directly into textures with no expensive conversion step.