Jump to content

Textures

Leadwerks Engine uses the .dds file format for textures, and can load uncompressed, DXTC1, DXTC3 and DXTC5 formats. Mipmaps and cubemaps are also supported. (Note: When saving a DDS file from Photoshop with the NVIDIA plug-in, make sure "Generate MIP maps" is selected or the DDS will not load correctly in Leadwerks.)
The materials system is designed to pack as much information into as few textures as possible. Consequently, you will not have separate textures for alpha masks or specular levels. Instead, the engine usually stores information in the alpha channel of the base texture and bumpmap.
Several texture tools can be downloaded in the Other Tools section.
Cubemaps
A cubemap is a texture with 6 images corresponding to the faces of a cube surrounding the viewer. These are used to render skies and reflections. The DDS texture format can store all six faces of a cubemap in one file.

Creating a Cubemap with NVidia DDS Utilities
Download NVidia DDS Utilities and place nvdxt.exe in the same directory as your 6 cube textures. All 6 textures must be the same dimensions in pixels. Create a new text file, open it in Windows Notepad, and add this text:
	day_rt.png
	day_lf.png
	day_up.png
	day_dn.png
	day_ft.png
	day_bk.png
Save the file and rename it "cubefaces.txt".

Now Create a second text file and open it in Notepad. Add this text:
  
  nvdxt.exe -cubeMap -list "cubefaces.txt" -output "day.dds"
	pause
Save the file and rename it "cubegen.bat". Double-click on this file and a console window will appear. A new DDS texture will be created containing your 6 textures.

Texture Slots
The first 10 texture slots are available to use. Texture slots 10-15 should not be used. Texture slots 16-32 may not be supported on all hardware.
0. User
1. User
2. User
3. User
4. User
5. User
6. User
7. User
8. User
9. User
10. Instance matrix texture
11. Reserved
12. Reserved
13. Terrain color texture
14. Terrain normal map
15. Terrain heightmap

Commands

AFilter
BindTexture
ClampTexture
CreateTexture
FreeTexture
LoadTexture
MaxAFilter
MaxTextureUnits
SetTextureQuality
TextureFilter
TextureHeight
TextureName
TextureWidth
TFilter
  • You cannot add records