User:Frost Salamander: Difference between revisions
Line 64: | Line 64: | ||
# Choose Image -> Scale Image... from the menu. | # Choose Image -> Scale Image... from the menu. | ||
# On the dialogue, either scale it to 256x256 px (if it was a 1024x1024 image originally), or just scale it down to 25% if it was something else. Click 'Scale'. | # On the dialogue, either scale it to 256x256 px (if it was a 1024x1024 image originally), or just scale it down to 25% if it was something else. Click 'Scale'. | ||
# Choose File -> Export as... | # Choose File -> Export as..., change the file name to 'texturename_ed.jpg' and click 'Export' | ||
# On the next pop-up, untick all the 'save data' boxes except for 'Save color profile' '''(ADVICE NEEDED)'''. Click 'Export' | # On the next pop-up, untick all the 'save data' boxes except for 'Save color profile' '''(ADVICE NEEDED)'''. Click 'Export' | ||
=== Create TDM materials file === | === Create TDM materials file === |
Revision as of 20:44, 8 June 2023
TDM Files and Contents
Content | File path | Notes |
---|---|---|
Skins | tdm_models_decls01.pk4\skins | skin files shipped with TDM |
Script Constants | tdm_base01.pk4\script\tdm_defs.script | constant values. Useful if you need to know the literal values for use in your scripts. |
Script Objects | tdm_base01.pk4\script | various script objects for entities. |
tdm_ai_humanoid_newskel.def | tdm_ai_humanoid_undead01.pk4\def\tdm_ai_humanoid_newskel.def | Base class for all TDM humanoid entities |
GUI Icons | tdm_gui01.pk4\dds\guis\assets\hud\ | HUD icons. e.g. loot, potions, etc |
sound shaders | tdm_sound_ambient_decls01.pk4\sound | ambient environmental sound shaders |
materials definitions | tdm_textures_base01.pk4\materials | base materials files |
Creating a material using existing images (e.g. from textures.com) using GIMP
Written on May 28th, 2023 using GIMP 2.10.34
This will describe how to create your own texture (material) using an image found on the internet. I will use textures.com as an example.
Ensure that the license for whatever source you use is appropriate for TDM (e.g. allows use in video games)
We will end up with 3 image files and one materials file:
- diffuse map (the base image with colour details, etc)
- normal map (faked bump/dent data)
- DarkRadiant editor icon
This doesn't cover creation of a specular map. This isn't needed unless your material needs a shiny surface (e.g. metal or wet surfaces).
Obtain your image
- Log into textures.com and find an image you like under the 'Regular Photos' section (NOT 'Special Content'). Make sure it's seamless if it needs to be tiled/repeatable (e.g. for bricks or walls). If it's something like a door or window, it doesn't need to be seamless. There is normally a JPG format that that is close to or exactly 1024x1024 pixels (ADVICE NEEDED). Download it.
Open your Image in GIMP
The first thing you may see here is a pop-up asking if you want to convert the image to 'the built-in sRGB color profile'. I'm not sure the implications of doing this but just choose 'Convert'. (ADVICE NEEDED)
Crop your Image
This is only needed if you don't intend to use the entire image as-is (e.g. if you want to cut a door or window out of an image). Skip this section if that is not the case.
- With the image in GIMP, select the Crop Tool (Shift+C).
- Under the 'Tool Options' tab, tick the box for 'Delete cropped pixels'
- Using the crop tool select the area you want to keep on the image with your mouse, and press 'Enter' when done.
Create the Diffuse Map
- With the original or cropped image open in GIMP Choose File -> Export as...
- In the next popup, change the filename to 'texturename.dds' and click 'Export'.
- On the next pop-up, choose 'BC3 / DXT5' for Compression and select 'Generate mipmaps'. Leave everything else as default. (ADVICE NEEDED) Click 'Export'
Create the Normal Map
- With the original or cropped image open in GIMP, select Filters -> Generic -> Normal Map..
- The image will change to a blueish colour and you will be able to see the 'bumps'. The only thing I adjust here is the 'Scale' property. If it looks very grainy, just reduce the scale. For things like bricks, I use a value < 5 or else the finished texture will look very grainy in TDM. For stuff like doors, a value of about 10 looks OK.
- After adjusting the scale, click 'OK'
- Choose File -> Export as..., change the file name to 'texturename_local.tga' and click 'Export'
- On the next pop-up, untick 'RLE compression' and leave 'Origin' at 'Bottom left'. Click 'Export'. (ADVICE NEEDED)
Create the editor icon
- Since you've modified the image, either close and re-open the image in GIMP, or go back into your Undo History and select the original image (or cropped image if it's been cropped).
- Choose Image -> Scale Image... from the menu.
- On the dialogue, either scale it to 256x256 px (if it was a 1024x1024 image originally), or just scale it down to 25% if it was something else. Click 'Scale'.
- Choose File -> Export as..., change the file name to 'texturename_ed.jpg' and click 'Export'
- On the next pop-up, untick all the 'save data' boxes except for 'Save color profile' (ADVICE NEEDED). Click 'Export'
Create TDM materials file
- Within your FM folder, save all your images in the appropriate TDM folder structure. Just follow the existing conventions. For example your DDS files go into 'dds/textures/darkmod/stone/brick' and your normal map and editor files go into 'textures/darkmod/stone/brick'
- Create the materials file as follows below. Give it a name like 'mybricks.mtr' and put it in the /materials folder in your FM. The material name as it appears in DarkRadiant appears at the top.
NOTE: 'texturename' in this example is 'bricks_dirty'
textures/darkmod/stone/brick/bricks_dirty { stone description "vine_friendly" qer_editorimage textures/darkmod/stone/brick/bricks_dirty_ed diffusemap textures/darkmod/stone/brick/bricks_dirty bumpmap textures/darkmod/stone/brick/bricks_dirty_local }