Post by marvinwankerstein on Sept 26, 2015 16:33:50 GMT -5
First, I'll describe the problem. GTR2 and GTL support a wildcard texture system that is different than Rfactor. This can make it a challenge to figure out what to do with the material names when converting cars from those games to Rfactor.
In case you don't know what the wildcard texture system is, it is used by the games to determine the names of textures for a car given a DefaultLivery. Cars are assigned material names for their textures and this system defines how the texture file names are determined for the various materials. For example, the material WCCARBODY has a texture defined for it but a car can override that with the specifier "DefaultLivery=" in the .veh file. There are several other material names that are mapped to image file names. As an example, let's say we have a car whose DefaultLivery is defined as "MyCar_001.dds". Following is a list of the other wildcard material names and texture file names that are derived from the default livery specifier :
GTR2 and GTL support a different wildcard material name system. There are no extras and the list is much shorter. Actually, there is a body1 and body2 texture along with a window texture and a few others. What is REALLY different though is how those textures can be re-used to have different material properties. Rfactor does not allow this. Here is a partial list of the material suffixes the GT games allow for a given texture :
WC_TEAM_BODY1_PA
WC_TEAM_BODY1_AL
WC_TEAM_BODY1_CR
WC_TEAM_BODY1_FL
WC_TEAM_BODY1_PL
The suffixes can help you can remember what kind of material it is - PA is paint, AL is aluminum, CR is chrome, FL is flat (or matte), and PL is plastic. There is also a GL suffix for glass and GL_A8 for glass with an 8-bit alpha channel for transparency.
This is where the challenge comes in. Given a single texture file that is used for five different materials, how can this be handled in Rfactor? Well, there at least three ways. Two of these ways are common but have drawbacks while the other way is rarely used but is much better.
The first way is to copy the default texture file and rename it for each material type. Typically, MyCar_001.dds will be copied to MyCar_001extra0.dds through MyCar_001extra4.dds. The drawback to this is it results in a much more texture memory usage by the game since the primary texture is usually a large one and people usually do not resize the extra textures. This is also means a bigger download for users. The Historix mod is a notable that used this technique.
The second way is to "merge" materials so those five different ones become one. This means all of the polys that are of other materials will appear like the painted car body's texture. Usually this is not a big deal and only noticable if you look really closely at a car. On the good side, there is only one instance of the texture used so it is more efficient for the game and for downloaders.
The third way has both of the benefits of the previous two but none of the drawbacks. By the way, I did not invent this technique. I first saw it used by the ORSM team on the V8factor mod. What it amounts to is material name aliasing. Each of the five materials for body1 listed above are mapped to extra textures - WCEXTRA0 through WCEXTRA4. The "tricky" part is we specify the "aliasing" textures in the car's .veh file. Also, we rename the file MyCar_001.dds to MyCar_001Livery.dds so MyCar_001.dds no longer exists. The key lines in the car's .veh file are these :
DefaultLivery="MyCar_001.dds"
...
Extra0="livery"
Extra1="livery"
Extra2="livery"
Extra3="livery"
Extra4="livery"
To extend this, let's say we have a window texture and it is used for WC_TEAM_WINDOW_FL and WC_TEAM_WINDOW_GL_A8 materials. We could handle that by changing the material name WC_TEAM_WINDOW_GL_A8 to WCWINDOW and WC_TEAM_WINDOW_FL to WCEXTRA5. Then, we name the window texture to "MyCar_001window.dds" and add this line to the .veh file :
Extra5="window"
This results in only one instance of the textures loaded by the game and one instance of the textures on your disc - the best of both worlds.
I know this is way late to the party but I believe this technique can also be used in Rfactor2.
In case you don't know what the wildcard texture system is, it is used by the games to determine the names of textures for a car given a DefaultLivery. Cars are assigned material names for their textures and this system defines how the texture file names are determined for the various materials. For example, the material WCCARBODY has a texture defined for it but a car can override that with the specifier "DefaultLivery=" in the .veh file. There are several other material names that are mapped to image file names. As an example, let's say we have a car whose DefaultLivery is defined as "MyCar_001.dds". Following is a list of the other wildcard material names and texture file names that are derived from the default livery specifier :
WCCARBODY MyCar_001.dds "DefaultLivery"
WCWINDOW MyCar_001window.dds
WCWING MyCar_001wing.dds
WCRIMS MyCar_001rims.dds
WCHELMET MyCar_001helmet.dds
WCDRIVER MyCar_001driver.dds
WCARMS MyCar_001arms.dds
WCEXTRA0 MyCar_001extra0.dds
WCEXTRA1 MyCar_001extra1.dds
WCEXTRA2 MyCar_001extra2.dds
WCEXTRA3 MyCar_001extra3.dds
WCEXTRA4 MyCar_001extra4.dds
WCEXTRA5 MyCar_001extra5.dds
WCEXTRA6 MyCar_001extra6.dds
WCEXTRA7 MyCar_001extra7.dds
WCEXTRA8 MyCar_001extra8.dds
WCEXTRA9 MyCar_001extra9.dds
GTR2 and GTL support a different wildcard material name system. There are no extras and the list is much shorter. Actually, there is a body1 and body2 texture along with a window texture and a few others. What is REALLY different though is how those textures can be re-used to have different material properties. Rfactor does not allow this. Here is a partial list of the material suffixes the GT games allow for a given texture :
WC_TEAM_BODY1_PA
WC_TEAM_BODY1_AL
WC_TEAM_BODY1_CR
WC_TEAM_BODY1_FL
WC_TEAM_BODY1_PL
The suffixes can help you can remember what kind of material it is - PA is paint, AL is aluminum, CR is chrome, FL is flat (or matte), and PL is plastic. There is also a GL suffix for glass and GL_A8 for glass with an 8-bit alpha channel for transparency.
This is where the challenge comes in. Given a single texture file that is used for five different materials, how can this be handled in Rfactor? Well, there at least three ways. Two of these ways are common but have drawbacks while the other way is rarely used but is much better.
The first way is to copy the default texture file and rename it for each material type. Typically, MyCar_001.dds will be copied to MyCar_001extra0.dds through MyCar_001extra4.dds. The drawback to this is it results in a much more texture memory usage by the game since the primary texture is usually a large one and people usually do not resize the extra textures. This is also means a bigger download for users. The Historix mod is a notable that used this technique.
The second way is to "merge" materials so those five different ones become one. This means all of the polys that are of other materials will appear like the painted car body's texture. Usually this is not a big deal and only noticable if you look really closely at a car. On the good side, there is only one instance of the texture used so it is more efficient for the game and for downloaders.
The third way has both of the benefits of the previous two but none of the drawbacks. By the way, I did not invent this technique. I first saw it used by the ORSM team on the V8factor mod. What it amounts to is material name aliasing. Each of the five materials for body1 listed above are mapped to extra textures - WCEXTRA0 through WCEXTRA4. The "tricky" part is we specify the "aliasing" textures in the car's .veh file. Also, we rename the file MyCar_001.dds to MyCar_001Livery.dds so MyCar_001.dds no longer exists. The key lines in the car's .veh file are these :
DefaultLivery="MyCar_001.dds"
...
Extra0="livery"
Extra1="livery"
Extra2="livery"
Extra3="livery"
Extra4="livery"
To extend this, let's say we have a window texture and it is used for WC_TEAM_WINDOW_FL and WC_TEAM_WINDOW_GL_A8 materials. We could handle that by changing the material name WC_TEAM_WINDOW_GL_A8 to WCWINDOW and WC_TEAM_WINDOW_FL to WCEXTRA5. Then, we name the window texture to "MyCar_001window.dds" and add this line to the .veh file :
Extra5="window"
This results in only one instance of the textures loaded by the game and one instance of the textures on your disc - the best of both worlds.
I know this is way late to the party but I believe this technique can also be used in Rfactor2.