This shows you the differences between two versions of the page.
— | howto:use_hires_textures_in_your_map [2009-08-13 15:08] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{cleanup}} | ||
+ | |||
+ | {{ file: | ||
+ | |||
+ | {{SideBox|1=The original version of this article by David " | ||
+ | [[http:// | ||
+ | |||
+ | |||
+ | ====== Preface ====== | ||
+ | |||
+ | |||
+ | This article focuses on how to create a texture resource [[pwad]] for use when mapping that takes advantage of the [[doomsday]] engine' | ||
+ | |||
+ | |||
+ | ====== Overview ====== | ||
+ | |||
+ | |||
+ | The Doomsday engine supports the use of high resolution (// | ||
+ | |||
+ | It is recommended to use PNG files whenever possible for the added flexibility of utilizing 24 bit when an alpha channel is not required. File sizes of the PNG format are also smaller. | ||
+ | |||
+ | **Notes:** //This how to assumes that you have some familiarity in creating new textures for the DOOM engine. I'll summarize the process shortly.// | ||
+ | |||
+ | This guide also uses the terms **folder** and **directory**. Normally, these two terms are synonymous and can be freely interchanged. Different utilities use different syntaxes. I'll try to use the same term the utility uses. | ||
+ | |||
+ | In regular DOOM, textures are created by combining one or more [[patch]]es. Patches are the actual graphic; the [[texture]] [[lump]]s are really just lists that define which patch or patches the engine needs to use to create the // | ||
+ | |||
+ | A texture can be created from just one patch, but interesting textures can be created by using two or more patches. The texture lists contain paramaters such as the canvas size of the texture e.g; 128x64, 128x128, 256x128... etc. Note that the canvas size must be multiple of 2. The //z-order// of the patches (which patch is placed on top of which other) and the [x, y] offset of a particular patch. The entire canvas must be //covered// by at least one patch, for example; You should not use just one 64x64 patch to build a texture that has a 128x128 defined //canvas// size. You would need to add that patch 3 more times to cover the entire canvas. | ||
+ | |||
+ | When loading a texture, Doomsday will first look for a hires version and if found, it will be used in it's place. All textures can be replaced in this way, regardless whether they originate from an IWAD or PWAD. The one requirement is that the file name of the hires texture (e.g. **shawn1.png**) name matches a name in the texture lists (e.g. **SHAWN1**), | ||
+ | |||
+ | For example, if you had a texture defined (named) as **mrblerck** consisting of three patches; **granite1**, | ||
+ | |||
+ | **Notes:** //In jDoom' | ||
+ | |||
+ | Another important thing to realize is that the engine will scale your hires texture to the exact texture canvas size. So, a 256x256 PNG file in all its detailed glory will be scaled to 64x64 in the game if the canvas size is 64x64. This is precisely how the higher resolution is achieved. | ||
+ | |||
+ | Ok, so knowing how this works, there should be a nagging little question in the back of your head, and that question should be: | ||
+ | |||
+ | //"If Doomsday only uses the TEXTURE1 entry for determining the name and size of the texture but does // | ||
+ | |||
+ | Not surprisingly, | ||
+ | |||
+ | //"Ok, smarty, but what about the editing process? Shouldn' | ||
+ | |||
+ | Ok. Yeah. You have a couple of options. You can use a simple reference patch that has a grid reference at 16, 24, 32, 64, 128, 256, etc. You can use this over-sized patch to create textures. Incidentally, | ||
+ | |||
+ | Ok, let's get on with it, then. | ||
+ | |||
+ | |||
+ | ====== Tools required ====== | ||
+ | |||
+ | |||
+ | Here follows a list of the tools used throughout this how-to. You are not obligated to use them and are free to use any comparitive tool but be prepared for the fact that this article' | ||
+ | |||
+ | * [[xwe]] - Used to create a resource [[pwad]]. | ||
+ | * [[doom_builder]] - Used to edit/create a map which uses high resolution textures. | ||
+ | * [[paint_shop_pro]] - Used to create the high resolution textures. | ||
+ | * [[pak_scape]] - Used to package the finished resources into a [[pk3]] for distribution. | ||
+ | |||
+ | **Notes:** //Some editors may not work or load a PWAD that contains texture1 entries made up of a small reference patch, or in one example above, a zero-length patch (marker). Some editors may even require you to use a patch that is quantized to the DOOM palette. Although note that some PWAD utilities may do that quantizing for you as long as the input format conforms to what it is expecting for a patch (8 bit PCX file or BMP file for example).// | ||
+ | |||
+ | The newest version of XWE now handles " | ||
+ | |||
+ | |||
+ | ====== Creating the resource PWAD ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Creating textures.wad ===== | ||
+ | |||
+ | |||
+ | Start XWE and create a new PWAD, we'll call it **textures.wad**. | ||
+ | |||
+ | |||
+ | ===== Importing graphics as textures ===== | ||
+ | |||
+ | |||
+ | |||
+ | ==== Creating the patch marker lumps ==== | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | |||
+ | ==== Importing a patch ==== | ||
+ | |||
+ | I'm now going to choose to use a **256x256** reference patch that is already using the DOOM palette. This will ensure that it will show up in your editor. If you're feeling brave, for extra credit, you can simply create an entry and place it between the two markers above, and use that null (zero-length) entry to build (the fake) textures with that JDOOM will replace with PNG files later. Just note that when you select these " | ||
+ | |||
+ | Here's the patch: | ||
+ | |||
+ | {{ file: | ||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | **Notes:** //The DOOM WAD format requires lump names to be at most eight characters in length.// | ||
+ | |||
+ | |||
+ | ==== Adding a patch to PNAMES ==== | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | |||
+ | ==== Defining a texture ==== | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | XWE has done a few things automatically for you. It's named the first new texture M_PATCH (as we discussed above), and it automatically determined the canvas to be equal to that of the dimensions of the patch. These two things are not required to stay that way at all, and we can adjust these values at any time. Let's do that now... | ||
+ | |||
+ | |||
+ | ==== Sizing the texture canvas ==== | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | **Notes:** //The patch is over-sized in comparison to the canvas size of the texture. That is OK. Furthermore, | ||
+ | |||
+ | We won't be seeing this texture in-game, however. We'll see the PNG file we name **TUT_01** in the jDoom textures directory. | ||
+ | |||
+ | Let's get a PNG file ready to go. The canvas size in the texture1 list means that the PNG file we use will be scaled to fit on any SideDef that is 128 long and in a sector that is 128 units tall. Obviously, it will be partially displayed if your SideDef (and sector height) is less than 128 units and tiled if your SideDef (and sector height) is more than 128 units. The important thing to realize is that if you create a PNG file that is 256x256 and name it TUT_01, the engine will SCALE the PNG file to match the canvas size. | ||
+ | |||
+ | It's not necessary to match sizes between PNG files and texture1 canvas sizes, just know the rules that will apply in either case. | ||
+ | |||
+ | Here's the high resolution texture that I'm going to use in this example: | ||
+ | |||
+ | {{ file: | ||
+ | |||
+ | Ok. Let's do another texture. Here's where it gets pretty easy. | ||
+ | |||
+ | |||
+ | ===== Creating a texture (via duplication) ===== | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | Now let's get a PNG file that we're going to use as that texture. Although the dimensions do not need to be exact, the ratio should be. For example, we could use a PNG texture of 128x256 and it will scale appropriately. For my example, I'm going to use a PNG texture that is 128x256. Here it is: | ||
+ | |||
+ | {{ file: | ||
+ | |||
+ | You can repeat this process for each and every new texture you want to create for your project. | ||
+ | Flats | ||
+ | |||
+ | |||
+ | ===== Importing graphics as flats ===== | ||
+ | |||
+ | |||
+ | Let me talk about flats quickly. If you're using Doom Builder version 1.5 or higher, you can use XWE to create zero-length entries between FF_START and FF_END in your PWAD. The names of the flats will show up in Doom Builder' | ||
+ | |||
+ | Another option is to use 64x64 24 bit PNG files as flats. Doom Builder 1.53 will display them fairly correctly. | ||
+ | |||
+ | In either case, it's not what's really in the PWAD that will show in the game. You'll want to use PNG files similarly to the way we did textures. The only difference is " | ||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | Now, let's import a simple placeholder Flat that uses the DOOM palette. For my example, I'm going to resize (resample) my hi-res PNG file and make it a 256 color bitmap that uses the DOOM palette. It might not look pretty, but at least it will show up in XWE. | ||
+ | |||
+ | NOTE: I could just put in the PNG file between the markers, as Doom Builder would display the PNG flat, but other editors may not support PNG files. So, let's just do it this way for now | ||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | There' | ||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | | {{ file: | ||
+ | |||
+ | |||
+ | **Notes:** //I have noticed a small issue with XWE version 1.12. Sometimes it will actually make your FF_END marker the flat, changing that marker from zero bytes to 4096 bytes. I have no idea if this is something I am doing wrong, or a bug with XWE. If that's the case, simply delete that FF_END entry and make a new one, or change the length to zero bytes. You may have to try to make your TUT_FLR a DOOM flat again. Not a huge deal, just a bit strange. Including working on this tutorial, it's happened to me only once before.// | ||
+ | |||
+ | | Here's what we'll see in the editor as a standard DOOM flat:{{ file: | ||
+ | |||
+ | |||
+ | |||
+ | ====== Considerations for distribution ====== | ||
+ | |||
+ | |||
+ | Ok. Now it's time to package all of this up and get it into the hands of the user. Let's assume that you have all the new textures and flats you need, and that you've already made your map. | ||
+ | |||
+ | The preferred way to distribute JDOOM specific content is using a PK3 file. | ||
+ | |||
+ | A PK3 file is just an uncompressed ZIP file. Although you can just keep the ZIP extension, it's better to use PK3 and associate PK3 with WinZip. Upon distribution, | ||
+ | |||
+ | JDOOM requires things to be in certain folders. If you didn't use the PK3 file, then here's where things go: | ||
+ | |||
+ | The MAP PWAD resides here: | ||
+ | / | ||
+ | |||
+ | The TEXTURE PWAD resides here: | ||
+ | / | ||
+ | |||
+ | (Yes, they can be merged into one PWAD if you so desire.) | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | The point of PK3 files is so that you can release the file with a virtual folder structure so you don't require the end user to have all these files all over the place. As long as your PK3 file (zip file renamed to PK3, basically) uses no compression (also known as " | ||
+ | |||
+ | |||
+ | ====== Creating the PK3 ====== | ||
+ | |||
+ | |||
+ | Although you can use WinZip to build your PK3 file, it does not allow you to dynamically create folders within the archive. That's why I recommend PakScape. Version 0.11 is the most recent (final?) version of this great program. | ||
+ | |||
+ | I won't burden you with too many screenshots, | ||
+ | |||
+ | {{ file: | ||
+ | - Launch PakScape | ||
+ | - Immediately save the file (even though it's empty right now). For our example, let's use texture_example.pk3. | ||
+ | - Don't forget to make sure that no compression is used. | ||
+ | - Create the following directory structure using **Object -> New Directory**, | ||
+ | - Place Textures and Auto inside jDOOM, and then place jDOOM inside /Data. | ||
+ | - Navigate to the Textures folder. | ||
+ | - Drag and drop your PNG files into this folder (or use Object -> Add File from the File Menu). | ||
+ | - Drag and drop your PWAD(s) into the /auto folder. | ||
+ | - Save your PK3 file. | ||
+ | |||
+ | |||
+ | ====== Finished! ====== | ||
+ | |||
+ | |||
+ | {{file: | ||
+ | Using DoomBuilder' | ||
+ | |||
+ | When playing this PK3 file in jDoom, it can be loaded with the [[file]] [[command_line_option]], | ||
+ | |||
+ | And that concludes this how-to on using custom, high resolution textures under Doomsday, with jDoom and how to construct a texture resource PWAD for use when building a map. | ||
+ | |||
+ | |||
+ | ====== See also ====== | ||
+ | |||
+ | \write me | ||
+ | |||
+ | |||
+ | |||
+ | |||