Terrain texturing
The beginings of the terrain system are coming together, and that’s good because this needs to be DONE. SOON.
Way too much time was spent fretting about the best way to create a direct X 10 texture array. The design shuffled back and forth between using GDI+ as an image loader, to using libjpeg/png, to trying to figure out DX10′s native methods. In the end, the method that was settled on should be fairly robust, if a bit roundabout. The individual image files are loaded using D3DX10CreateTextureFromFile(), and the resulting Texture2D objects are copied into the texture array using CopySubresourceRegion(). There is some extra copying going on, but we won’t have to worry about image formats, or converting between different channels/bit depths. The only problem with it now is how to handle mipmaps, which should just be calling CopySubresourceRegion() with the right parameters, or once per mip.
The whole point to this ordeal is to make layering terrain textures easy: textures themselves would go into one array, while texture masks into another. In the terrain vertex shader, per-vertex texture weights will be calculated using the masks. The final blend will be taken care of by the pixel shader.






