Brian Woodward
10th January 2005, 13:36
Creating Style Libraries of textures and cutouts
In Piranesi, styles in a Style Library can reference external files. For example, a brush can reference a bitmap file and a cutout can reference a model file (such as .SKP). When you are creating style libraries of textures, grains, brushes, and cutouts which reference external files, there are three areas to first consider:
1. Where on disk the files that are referenced by a style should live.
2. Properties of the files, such as resolution (sizex in pixels) and format.
3. Which properties of the style in the style file to set or leave unset.
Let’s look at these in order.
Where on disk the files should live
Before you create a library of styles which reference files on disk, it will be much easier if you get the structure of the files correct in the operating system. You might, for example, create a folder for cutouts and a subfolder for people, trees, etc., and a separate folder for textures and grains, with further subfolders to categorise these. Getting the correct structure will make using the Style Library Builder a lost easier.
Don’t place the data in a subfolder of the Piranesi program folder as this may cause problems later when you upgrade the program.
The next question to be answered is: should I store them locally on my PC or on a network disk? This is a question you will need to answer for yourself, but here are some things to consider:
• Performance
Loading styles is likely to be faster if the files are stored locally, but you may not have enough disk space.
• Sharing data
If you are sharing your data with others in your organisation, then it’s probably best to have the data stored centrally on the network.
• Remote working
If you want to use your library on your laptop on the move, how will you achieve this? You could maybe burn a CD as well.
• Backup strategies, your data is valuable
Format for raster files
Piranesi can read several raster file formats as brushes, textures, grains, and cutouts. Which ones should you create? We would generally recommend that you use PNG files:
1. The PNG format allows compression to reduce the file size, and is also a lossless compression. This means that no information is lost as part of the compression. This is not true for all compressions; JPEG is lossy and can introduce artefacts into the stored image. These can cause unwanted halo effects with cutouts.
2. PNG files store an associated alpha value with each pixel.
Resolution for raster files
The resolution of your library files is probably going to be a personal choice and depends greatly on the resolution of the EPix files that you work with. In general I would recommend that you store the files with twice the resolution of the eventual size of the cut-out in your EPix file.
This may mean that you want to organise your cut-outs into different folders of resolution. You could have a high resolution set for use in the foreground, lower resolution ones for use in the background.
Creating the style libraries
The easiest way to create the style libraries is to use the Style Library Builder (Library -> New-> Style Library Builder). This will lead you through a series of dialog boxes to create a style library of styles of all the same type. So for example it will create a style library of cutouts. Let’s run through the steps to create a style library of cutouts, using the Style Library Builder:
1. On the first dialog box displayed, select style type: Cutout.
2. Browse to the folder containing all your cutout files. Note any subfolders in this folder will become categories in your newly created style library.
3. Provide an alias for all the cutout files. This should be a new alias not used before. We would recommend that you do use an alias name for the folder. Then, if you later decide to move the location of your cutout files later (say you move them from a local disk to a network drive) you will only have to redefine the alias and not edit the paths of all the files used in the styles one at a time.
4. On the next dialog box, click Next,. You probably want to take the default options, except maybe the size for raster cutouts. Here, it is more likely that you would select Height than Width.
5. Click Next, and specify the location of your style file and a name for it. This is the name that will appear in the Piranesi Style Browser when you work with the library. Note it is probably best to store the style library in a directory near the cutout files themselves.
6. When you click Finish, the Style Library Builder will take a few minutes to create a style library containing one style per file in the directory of cutouts you specified.
Each style created is a partial style. That is, they do not have any lock or fade settings for instance. This means that, when you apply a style, the current lock and fade settings of the toolbox are not changed. Since this may cause problems for novice users, you might want to modify the styles to include an explicit setting of no locks and no fades.
To do this you will need to apply each style in turn, check you have the correct toolbox settings and then use Library-> New-> Style to overwrite the existing style with the lock and fade check boxes selected on the Style Properties dialog box.
While you are updating the styles, you should also bear in mind that all the cutouts you have created have the same height (or width). To make the library more usable, set the correct height for the cutout as you apply each style. This can be a tedious process, and best done over a period of time.
Texture and grain files
The text above really discusses putting cut-out libraries together. The principle for Texture and Grains styles are very similar. Care should be taken when choosing the relevant texture mapping modes.
In Piranesi, styles in a Style Library can reference external files. For example, a brush can reference a bitmap file and a cutout can reference a model file (such as .SKP). When you are creating style libraries of textures, grains, brushes, and cutouts which reference external files, there are three areas to first consider:
1. Where on disk the files that are referenced by a style should live.
2. Properties of the files, such as resolution (sizex in pixels) and format.
3. Which properties of the style in the style file to set or leave unset.
Let’s look at these in order.
Where on disk the files should live
Before you create a library of styles which reference files on disk, it will be much easier if you get the structure of the files correct in the operating system. You might, for example, create a folder for cutouts and a subfolder for people, trees, etc., and a separate folder for textures and grains, with further subfolders to categorise these. Getting the correct structure will make using the Style Library Builder a lost easier.
Don’t place the data in a subfolder of the Piranesi program folder as this may cause problems later when you upgrade the program.
The next question to be answered is: should I store them locally on my PC or on a network disk? This is a question you will need to answer for yourself, but here are some things to consider:
• Performance
Loading styles is likely to be faster if the files are stored locally, but you may not have enough disk space.
• Sharing data
If you are sharing your data with others in your organisation, then it’s probably best to have the data stored centrally on the network.
• Remote working
If you want to use your library on your laptop on the move, how will you achieve this? You could maybe burn a CD as well.
• Backup strategies, your data is valuable
Format for raster files
Piranesi can read several raster file formats as brushes, textures, grains, and cutouts. Which ones should you create? We would generally recommend that you use PNG files:
1. The PNG format allows compression to reduce the file size, and is also a lossless compression. This means that no information is lost as part of the compression. This is not true for all compressions; JPEG is lossy and can introduce artefacts into the stored image. These can cause unwanted halo effects with cutouts.
2. PNG files store an associated alpha value with each pixel.
Resolution for raster files
The resolution of your library files is probably going to be a personal choice and depends greatly on the resolution of the EPix files that you work with. In general I would recommend that you store the files with twice the resolution of the eventual size of the cut-out in your EPix file.
This may mean that you want to organise your cut-outs into different folders of resolution. You could have a high resolution set for use in the foreground, lower resolution ones for use in the background.
Creating the style libraries
The easiest way to create the style libraries is to use the Style Library Builder (Library -> New-> Style Library Builder). This will lead you through a series of dialog boxes to create a style library of styles of all the same type. So for example it will create a style library of cutouts. Let’s run through the steps to create a style library of cutouts, using the Style Library Builder:
1. On the first dialog box displayed, select style type: Cutout.
2. Browse to the folder containing all your cutout files. Note any subfolders in this folder will become categories in your newly created style library.
3. Provide an alias for all the cutout files. This should be a new alias not used before. We would recommend that you do use an alias name for the folder. Then, if you later decide to move the location of your cutout files later (say you move them from a local disk to a network drive) you will only have to redefine the alias and not edit the paths of all the files used in the styles one at a time.
4. On the next dialog box, click Next,. You probably want to take the default options, except maybe the size for raster cutouts. Here, it is more likely that you would select Height than Width.
5. Click Next, and specify the location of your style file and a name for it. This is the name that will appear in the Piranesi Style Browser when you work with the library. Note it is probably best to store the style library in a directory near the cutout files themselves.
6. When you click Finish, the Style Library Builder will take a few minutes to create a style library containing one style per file in the directory of cutouts you specified.
Each style created is a partial style. That is, they do not have any lock or fade settings for instance. This means that, when you apply a style, the current lock and fade settings of the toolbox are not changed. Since this may cause problems for novice users, you might want to modify the styles to include an explicit setting of no locks and no fades.
To do this you will need to apply each style in turn, check you have the correct toolbox settings and then use Library-> New-> Style to overwrite the existing style with the lock and fade check boxes selected on the Style Properties dialog box.
While you are updating the styles, you should also bear in mind that all the cutouts you have created have the same height (or width). To make the library more usable, set the correct height for the cutout as you apply each style. This can be a tedious process, and best done over a period of time.
Texture and grain files
The text above really discusses putting cut-out libraries together. The principle for Texture and Grains styles are very similar. Care should be taken when choosing the relevant texture mapping modes.