|
Unreal's 3D hardware rendering code gracefully handles textures of all sizes from 1x1 up to 1024x1024, though the actual rendered texture resolution is limited to texture sizes which the hardware supports. All current hardware is limited to 256x256 textures. For example, when you see a 1024x1024 texture on 3dfx hardware, Unreal substitutes a lower resolution (256x256) version of the texture. The texture is scaled up properly, so that the only noticeable artefact is blurring of the texture. Because most current 3D hardware (time of the GOTY version) only supports textures up to 256x256, we generally don't use higher resolution textures in our game. The Unreal team creates textures in Fractal Painter and Photoshop, always working with the source art in 24-bit color. When a texture is complete, it is converted into a 256-color, palettized .pcx or .bmp file and imported into UnrealEd. To import a texture into UnrealEd, go into the texture browser (on the right side of the screen), and click on the "Import" button. When importing a texture, you can specify its name, the texture group it should appear in, and the package (.utx file) it should be saved in. A texture mapping feature called "masking", where color zero is treated as if it were transparent. We use this for textures like vines, grating, and sprites. To create a masked texture, you will need to use a 256-color paint program to edit your image and apply color zero to the transparent portions of the texture. Then, import the texture and click on the "Masked" checkbox in the texture importing dialog. If you don't click on the "Masked" checkbox, the texture's mipmaps will not be properly masked. When you import a texture, UnrealEd will automatically create mipmaps for the texture (mipmaps are lower resolution versions of the texture, used for antialiasing far-away polygons). When you import two textures which use the same palette, UnrealEd makes note of this fact and takes advantage of it for optimization. In hardware rendering, the frame rate is partly dependent on the number of palettes visible in a scene, so there is a performance advantage to forcing textures to have the same palette. Programs like Image Alchemy can convert groups of 24-bit color images to 8-bit and force a common palette. When you import a texture into UnrealEd, it looks for _A## in the name and then sets up the texture for animation. When you import animating textures into UnrealEd, the editor shows all of the individual frames of animation. However, you should always use the first one (the one with the name ending in A00) when setting the texture's properties and adjusting its frame rate. The following useful texture properties are related to animation: For texture animation, we support two animation rates (MinFrameRate and MaxFrameRate) to prevent "animation aliasing": the annoying artefacts you see when a texture animates through frames at a variable rate, such as "1 2 2 3 4 4 5". When the rendering frame rate is between MinFrameRate and MaxFrameRate, the texture will always animate smoothly, i.e. "1 2 3 4 5". Detail textures and Macrotextures only are visible on 3d hardware. For performance reasons, they are ignored in the software rendering code. When you bring up the "texture properties" editor, you can associate a detail texture and a macrotexture with a given texture. When you import a detail texture, you need to set its Scale value to a small number (typically 0.25) to specify its scaling relative to whatever texture it applies to. Macrotextures need to have their Scale value set to a large number (typically 8 ) to specify its scaling relative to the surface it's applied on. It is valid to use procedural textures as macrotextures, microtextures, or both. Detail textures and macrotextures modulate (multiply) the surface they're applied to. By modulating, they have the ability to scale the surface's brightness up or down. Colors with RGB brightness values from 0-127 darken the surface; 128 has no effect; and 129-255 brighten the surface. Therefore, when drawing microtextures and macrotextures, it is important that you design them with their brightnesses in the proper range so they affect surfaces naturally. If a detail texture's average brightness deviates too far from 128, then surfaces will appear to brighten or darken as you approach them. |