Very simple texture creation

Discussion forum for Devil Whiskey 3rd Party MODS.

Moderator: Admin

Post Reply
User avatar
Rickstavern
Black Claw
Posts: 109
Joined: Tue Feb 22, 2005 11:34 am
Contact:

Very simple texture creation

Post by Rickstavern »

This first post is a simple explanation of what you might need in order to create new textures for your MOD. This is pretty basic stuff. The point of this is to help people get started and to show how very easy it can be. I will try to cover a few more advanced issues later.

What you will need

You will need some graphics editing software. I use Paintshop Pro for all of my image editing. You can use MS Paint or other free image editing software, but you will be missing a large number of tools that will make the entire job easier.

There are many free image resources available. There are also some not-so-free resources out there that contain thousands of textures. To get started I suggest that you find a few repeating tiles with a brick or stone pattern. These types of images can easily be turned into dungeon walls.

The texmake program

The texmake program is used to turn your images into game usable textures. This program is available with the Devil Whisky Toolkit. The toolkit is available on the Renibister Hall website.

The size of the textures is based on a 256x256 pixel square. For textures that are two units tall (outdoor zones only) the size will be 256 pixels wide by 512 pixels tall. The tallest definable wall is four units high and will use a texture size of 256x1024. There is a limitation in the program when you attempt to define a texture that is three units tall. You must create the image as 256x512. The texmake program cannot create a texture that is 256x768, but the game will stretch a 256x512 texture out to fit onto a wall that is three units in height. This results in a loss of resolution. At this time I do not think that the texmake program will be updated to properly handle textures for walls with a height of three. All floor and ceiling textures are 256x256

When you are editing images, be sure to save all of your work in a lossless format. Saving as a simple Windows bitmap (.bmp) file is sufficient. You will only need to convert the file to JPEG once you have finished. JPEG is the only format that the texmake program will recognize.

Let's make a simple wall

Okay, so you found a simple repeating tile. The first thing you need to do is to make sure that the image is 256x256 pixels. If it's not then you need to resize it. That's it. Make sure that the file is saved in JPEG format.

http://pg.photos.yahoo.com/ph/rickstave ... m=6e6f.jpg

Texmake is a command line program and is used in the following manner:

Code: Select all

texmake <output file name> <input file name> <alpha channel file name> &#91;reduction factor&#93;
Output and input files are pretty self explanatory. The alpha file is used to create transparency in your textures. The reduction factor is optional and is used to control how much a tile is reduced for the "small" version. The small version is used when you see the texture from a distance when you are in the game.

To turn our test image into a game texture, use the following command:

Code: Select all

texmake testimage.dat testimage.jpg NULL
That's it!

The file testimage.dat can now be used in the game.

Next time we'll try to make a transparent doorway.
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Rick, I just can't see that 'transparent' doorway you're referring to.. :?
:wink:
Seriously, that's a damn fine explanation of texture creation--sure I'd never even try it sans your super-lucid step-by-step.. :D

Thanks...sure I speak for the whole sorry lot when I type in quotes "Arurhg, we dost look forward to more!"

quick ?: You said the 'Reduction Factor' is opt, so will the game automatically handle the RD properly if/when you don't specify it?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
ShadoKnight
Nomad
Posts: 28
Joined: Mon Mar 21, 2005 2:05 pm

Post by ShadoKnight »

Couple comments:

1) The reason 256x768 isn't supported has nothing to do with texmake, and everything to do with limitations of OpenGL (without using non-power-of-2 textures, which are a relatively recent addition to the spec) - so no, texmake will not support 256x768 in the near future (ok, I'm not a developer anymore, so I can't be absolute, but let's say it's very unlikely). You *can* if you want high-res 3-unit walls, use 256x1024 and they will be shrunk. But it should also be noted, that having 256x512 and stretching it (as long as it's properly designed) won't actually have a noticable effect on resolution, because the resolution of the rendered image is very rarely (if ever) more than 512 pixels high, anyway.

2) You can use taller walls in-doors, as well as out-doors, but the 'height' is measured from the ceiling, and you need to be very careful in architecting your level so that you don't have holes. Using height 4 ceilings in-doors, however, can create some very nice dungeon effects!

3) The reduction factor is optional, and if not specified, defaults to 2 (IIRC). This is used to create the lower-resolution textures used in the reduced quality modes for the game.

Great tutorial - I hope it helps folks out! ;-)

SK
User avatar
Rickstavern
Black Claw
Posts: 109
Joined: Tue Feb 22, 2005 11:34 am
Contact:

Post by Rickstavern »

I am sorry that I have not yet posted an update. There are times when I am too busy to do much fun type work.

Since I am still waiting for the developers to release the corrected actions editor then I will try to write a follow-up to this post soon. Once the action editor is released then I will attempt to complete the MOD.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

I, for one, can't wait to make a transparent doorway. Creating textures is the one tool that I really haven't tried too often. I am sure that others are interested, as well.
I reject your reality, and substitute my own.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

I will try on my own to make a transparent door. There are a few testures that I need to make, so I guess we will see how it works out.

Any help on this would be appreciated, or else I will just try to make it work through the tutorial.
I reject your reality, and substitute my own.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Well, the tutorial does not seem to cover any of these picture issues.

If Rick is feeling up to it, hopefully he will be willing to show us how to make transparent doorway textures. :D
I reject your reality, and substitute my own.
User avatar
Rickstavern
Black Claw
Posts: 109
Joined: Tue Feb 22, 2005 11:34 am
Contact:

Post by Rickstavern »

I apologize for my absence. There were other priorities.

If you have any addtional graphics creation questions then I will try to answer them as best I can when I next update
User avatar
Rickstavern
Black Claw
Posts: 109
Joined: Tue Feb 22, 2005 11:34 am
Contact:

Post by Rickstavern »

Here is an update that I should have posted along time ago

Alpha channel and tranparency

It is sometimes desirable to create textures that are partially or completely transparent. This is done by creating and alpha channel for an image. This is a separate image that is used along with a source image to create a complete texture. For this new image, any area that is black (typically color value 0) is completely transparent. Any white area (color value 255) is completely opaque. Values between these two extremes (shades of grey) will result in a partially transparent texture.

Here we go


The source image

We will use the same wall image that was used before, except this time with a simple door frame.

http://pg.photos.yahoo.com/ph/rickstave ... m=c3c5.jpg

This new texture will match the plain wall that we made before. It's not typically realistic or intuitive to have people stepping through solid rock into a new room, so we had best put a hole in the middle of one of our walls.

To do this we will create a new image. The solid parts of the wall will be represented by the color white and the doorway will be represented by the color black.

http://pg.photos.yahoo.com/ph/rickstave ... m=57f8.jpg

This new image is the alpha channel. Compare the two images side by side. The black area in the middle of the alpha channel corresponds to the area in the door image that we want to make transparent.

Now we need to turn them into a complete texture. Once again, the command for creating a texture is:

Code: Select all

texmake <output file name> <input file name> <alpha channel file name> &#91;reduction factor&#93;
For our images, the command will be:

Code: Select all

texmake testdoor.dat testdoor.jpg testdooralpha.jpg
You have now made a new texture that has a doorway that you can see through. You can use testdoor.dat in you map right away!
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Okay. I'll try that and see what happens!!
I reject your reality, and substitute my own.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Well, it is not much, but I was able to create a "mountain"


Image

It is a little thin, so I have to figure out a way to beef it up a little. But, it is a start.
I reject your reality, and substitute my own.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

I don't have a picture, but I was able to get a slightly better looking mountain, although it is still a little thin. I will try to post another picture later.
I reject your reality, and substitute my own.
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Pretty cool guys.. :P

(hmm...even Grand Ole Mod-Gods seem to have trouble crafting phat mountains :wink:)
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Okay, here are the old mountain (top) and new mountain (bottom, obviously)

Image
Image

As you can see, the mountain on the right has a little more curvature on the bottom, so it looks a little more realistic to me. I also made the mountain as a garnish, so the mountain is always facing you, which also adds to the affect.

It is still a little thin, but I don't think that is going to change.
I reject your reality, and substitute my own.
Post Reply