Contents - Index - Previous - Next
The texture type "File"
The texture type "File" has the following specific parameters:
link -- the non-editable parameter that shows is the link valid (1) or not (0). The corresponding path to the texture file is shown in the Status bar.
aspect -- the Boolean variable in range [0,1] -- ignore the aspect ratio (width:height) of the texture file or take it into account. If "0", the texture is rendered as a square picture, even if the width and height of the original picture are different. The default value is "1".
The parameter "aspect" can be useful, when you would like not to take care about the aspect ratio of the original picture. For example, see on the picture below how the world maps are exposed on the cylindrical surfaces. With the parameter "aspect" = 0, both maps will have the same contours in spite of they are loaded from different files.
Links to texture files
When you choose the texture type "File" in the combo box TEX, and create the texture from a picture file, the application remember the link (the path on your PC) to this file in the record of the texture parameters. You can see this link (the corresponding path) in the Status bar, when you select the parameter "link" in the combo box TPAR.
When you save the scene in a scene file, only the link (the string with the path) but not the picture itself is saved in the scene file. It allows the scene files to be as short as possible.
When you open a scene file, the application read all the links, and load the corresponding picture files to create the texture objects in the computer memory. It uses the link also when a particular texture object should be recreated (for example, when you change the resolution of the texture).
Note that the links are defined in the file system of the particular computer, on which the scene was created or reedited. Therefore, when you send a scene file to (or receive it from) another computer, the links might be obsolete or "broken". We solve the problem of the broken links in two ways.
For the texture files that are included in the installation package and are located in the folder "Textures" (inside the installation folder), we use file names prefixed by "tx_". We call such textures "standard" in this tutorial.
When the application faces a broken link with the file name that begins with the prefix "tx_", it looks for the same file in the folder "Textures". If the file is found, the application automatically rewrite the string by the path that corresponds to the location of the folder "Textures" on the current computer. So that, if you then save the scene in a scene file, it will contain the new valid path. If it is possible, do not use the prefix "tx_" for the names of other non-standard picture files.
If you use only standard textures, you can send your scene files without any comments, and all the links will be recognized by another computer. Note that all our products have the same set of standard textures. The standard set contains almost two hundreds files. It is enough for the beginning.
However, we understand that the most interesting is the possibility to use any picture files of popular formats. With our products, you can use for textures any picture files of formats BMP, GIF, JPEG, and ICO, even a photograph with your own portrait.
To solve the problem of broken links that arises in the case of non-standard textures, you can use the menu commands that are described in the next section below.
The idea is that the sender should to export all non-standard texture files of a scene to a separate temporary folder using the command "Export Texture Files To". Note that the original files stay in the original folder. Then, the scene together with this temporary folder can be sent to another computer. The recipient put the received files somewhere on the computer-receiver, opens the scene, and uses the command "Redirect Broken Links To" to set a folder to which to redirect broken links (where to search for the lost texture files).
Until all the broken are fixed, the application substitute each broken link by a simple texture "File not found". The string with the obsolete path will not be corrected until the valid path will be found.
You can use these menu commands to organize your own collection of the additional (non-standard) texture files. Let us consider the following possible scenario. When you receive a scene with new textures, you do not know are these textures good enough to use them later in other scenes. Therefore you can put them in a temporary folder, and use the command "Redirect Broken Links To" to consider the received scene. If all the textures are good, you can export them to a desired folder inside your collection using the command "Export Texture Files To", and then use the command "Redirect All Links To" that redirects all (not only broken) links to a new specified folder. Then you can delete the temporary folder (not to duplicate the same files). If you plan to add only some but not all of the new files to your collection, use your file manager to copy or move the desired files, and then use the command "Redirect All Links To". The command changes the string with the path only if the file is found in the target folder.
Note that all these procedures never overwrite the existed files. Therefore, if two files located in different folders contain different pictures, but have the same names, you should manage them by yourselves using your file manager.
Working with the textures from files, you can use the following commands of the Edit menu:
Please note that we use the common Windows dialog of the type Open in an unusual way for the commands "Redirect Broken Links To", "Export Texture Files To", and "Redirect All Links To". When the Open dialog appears on your screen, you should to select only a folder but not an actual file within it. Therefore, after you selected the desired folder, you can select any file (if there is any), or type in any name (even one letter "a") in the field "File name", and then click on the button "Open". Actually, the application will not open any file. It simply remembers the folder, and then use it to implement the command.
Say, you would like to export textures to the temporary folder "House". Click on the menu command "Export Texture Files To". When the dialog appears, it looks like one on the screen shot below. Find the folder "House" in the "Look in" section. You see the hint "Select any file, or type any name" in the field "Files of type". The folder "House" is empty, you cannot select a file. Type any name or a letter in the field "File name", then click on the button "Open".