Trasparency & glasses in creating MOD

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.

 

Registration and use is of course free for you.

 

We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • Hello everyone, I'm creating a MOD. it is a ship really existed (is the model of Ferry Iginia 1969-2012 or sisters Rosalia & Sibari). Its 3D is near finished. Now I painting this object. I had excellents results realizing teak cover over the bridge using a pattern with GIMP. But now I facing hard difficulties realizing glass for windows of the ship. Consider that I doing attempt creating texture of the type "metal glass ao" having red, green, ble and alfa channels. My model have phisical windows on its 3D mesh (realized with Blender). I desire help from everyone of course, but specifically from DH-106:love:.

  • I concur with EISFEUER, this is a very stylish ship with classic 1950s lines.


    If You have the windows as separate meshes, it´d be easiest to just assign them the material type "PHYSICAL_TRANSPARENT". This material just requires two tiny files: map_albedo_opacity (colour and transparency) and map_metal_gloss_ao (metallic and reflective properties and ambient occlusion). If You don´t require structure on the glass, a 256² or even 128² texture size will suffice here.


    The lower deck windows... yes, You can of course use a combined material type like PHYSICAL_NRML_MAP_OP. However, bear in mind that transparent windows need something behind them, or else You´ll end up with holes that show the ocean and the far bank of the river, not the ships inside. This will complicate matters a little as You´d need to install some additional interior.


    Also, the mentioned material will not allow for aging, rust or freely selected colouring. If You want either of those effects, you could consider the material type PHYSICAL_NRML_MAP_CBLEND_DIRT. This allows for all those effects (you can use either or all, as You like), but would require painting the small windows on as black, possibly reflective, circles.


    Here You find a lexicon article on materials - while it is originally for TPF1, its essence still is true for TPF2. You will find a list of materials and their abilities in there so You can pick what You need and see what maps the material takes to achieve Your required looks :)

  • Sorry my dear enthusiasts, but I am at a much lower level than you think, perhaps for the (quite) good model that you have seen in the figure above and you think that I am at your level but I can only do 3D (a little), make a simple UV map, make projections of tops "project from view" by pressing the "U" button in the 3D viewport where the ship is; having introduced a file.tga empty in the UV map of Blender , make an "export UV layout" to be superimposed on this .tga file in Gimp to color and produce textures of the type "albedo" or "metal gloss ao" to introduce in MOD folder system of the ship; and then transform the 3D into FBX and, by means of model editor get the mesh files, I can organize (a little) the material file and (a little) the .mdl file (that just you, DH-106, teached me to better manage some week ago). And I can do little else. I don't understand anything when you talk to me about "maps" or materials like "PHYSICAL_TRANSPARENT." How do I use it ? Inside file material? (probably it is a command that if used with correct syntax the game understads). So I need very basic and schematic help, like: a) do this; b) do this other; etc. So, as I kindly told you, I can't get the window panes on this ship. I hope (...and pray) you can teach me how to do them easily. In thanking you intensely in advance, I wish you all a joyful and happy W.E.:love:

  • Can I take as reference model your material file for Antonov plane like this one below?

    ------------------------------------

    "

    function data()

    return {

    order = 0,

    params = {

    albedo_scale = {

    albedoScale = { 1, 1, 1, },

    },

    alpha_scale = {

    alphaScale = 1,

    },

    alpha_test = {

    alphaThreshold = 0.5,

    cutout = false,

    },

    color_blend = {

    albedoScales = { 1.5, },

    colors = {

    { 0, 0, 0, },

    },

    },

    dirt_rust = {

    age = 0,

    dirtColor = { 0.5, 0.5, 0.5, },

    dirtOpacity = 0.5,

    dirtScale = 1,

    rustColor = { 0.37254902720451, 0.22745098173618, 0.16470588743687, },

    rustOpacity = 0.5,

    rustScale = 1.6730800867081,

    },

    fade_out_range = {

    fadeOutEndDist = 20000,

    fadeOutStartDist = 10000,

    },

    map_albedo_opacity = {

    fileName = "models/vehicle/train/v300/skyjoe/grimes_v300_db1_albedo_opacity.dds",

    type = "TWOD",

    },

    map_cblend_dirt_rust = {

    fileName = "models/vehicle/train/v300/v300_cblend_dirt_rust.dds",

    type = "TWOD",

    },

    map_dirt = {

    fileName = "models/vehicle/train/v300/skyjoe/grimes_v300_db1_dirt_albedo.dds",

    type = "TWOD",

    },

    map_dirt_normal = {

    fileName = "models/vehicle/train/v300/skyjoe/grimes_v300_db1_normal.dds",

    redGreen = true,

    type = "TWOD",

    wrapS = "REPEAT",

    wrapT = "REPEAT",

    },

    map_metal_gloss_ao = {

    fileName = "models/vehicle/train/v300/skyjoe/grimes_v300_db2_metal_gloss_ao.dds",

    type = "TWOD",

    },

    map_normal = {

    fileName = "models/vehicle/train/v300/skyjoe/grimes_v300_db1_normal.dds",

    redGreen = true,

    type = "TWOD",

    },

    map_rust = {

    fileName = "models/vehicle/rust_albedo.dds",

    type = "TWOD",

    },

    map_rust_normal = {

    fileName = "models/vehicle/rust_normal.dds",

    redGreen = true,

    type = "TWOD",

    wrapS = "REPEAT",

    wrapT = "REPEAT",

    },

    normal_scale = {

    normalScale = 1,

    },

    polygon_offset = {

    factor = 0,

    forceDepthWrite = false,

    units = 0,

    },

    two_sided = {

    flipNormal = true,

    twoSided = false,

    },

    },

    type = "PHYS_TRANSPARENT_NRML_MAP_CBLEND_DIRT",

    }

    end


    "

    -----------------------------------

    1) the line with type is the line with the command for type of material, is'nt it?


    Important questions to understood:


    2) It is necessary to have this glass to in some way introduce them during modelation in Blender, for instance mapping some part of the 3D construction in alpha channel or is possible proceed after the blend work having already a texture file with all the part of object projected over it wth the UV map?


    3) It is compulsory have interior parts in the model in the other side of the glass to have transparent effects or is possible have those effects without those interor parts in the model?


    4) How line I can put in the file material fir the file not still ready to let TF2 ignore it, perhaps some like "unknown_albedo_1k.tga" or "default_metal_gloss_ao.tga" or I can symply not write all the block

    map ...{...}, is'nt it?


    thank<s in advance.

  • Ok, so let´s get to the basics a little here.


    First of all, there is the mesh. It consists of parts, tris, n-gons. This is what defines the shape of a part. Nothing more - just the shape.


    And then, in order to define the looks of the part, along comes the material. This lends the mesh its outward appearance: colour, shine, reflectivity, transparency and so on.


    You can see the mesh as a bare cinema screen and the material as the projector that makes it show a picture - this comparison is rather realistic in fact as the material is nothing but a picture file that is projected on the mesh and does various things to it.


    Now, there are obviously various picture files in a material as in the one You have quoted above (which is none of mine, it rather seems to come from Skyjoe and Grimes). Let´s now look at what they do:


    "Map_albedo_opacity" defines the colour via RGB and opacity, presumably via alpha.

    "Map_normal" is the normal map, defining the surface structure.

    "Map_metal_gloss_ao" defines metallic shine in the red channel, general gloss in the green and ambient occlusion (interference shade in corners of the model) in the blue channel.

    "Map_cblend_dirt_rust" does the same for user-selectable colouring (defining the areas to be such treated) in red, short-term grime in blue and long-term rust in green.

    "map_dirt", "map_dirt_normal", "map_rust" and "map_rust_normal" are what the map_cblend_dirt_rust" takes the structure of the dirt and rust from, so those are only to be used in conjunction with the former. Those maps are included in the game, it is well possible to use the vanilla ones and only give them some initial bias via the material.


    And that said, I´ll get to Your questions now.

    ad 1. Yes, the line "type=" defines the material. What You write in there will result in the game looking for the texture files associated with the requested material type, some of which have been described above.


    ad 2. You can use two methods to define glass.

    a. Build the parts You want to be transparent as separate meshes and use "PHYSICAL_TRANSPARENT" as material type, OR

    b. Use the material type You quoted above and use the mentioned alpha channel in the map_albedo_opacity to define local transparency.


    Method A is much more accurate and allows for rather precise definition of windows but comes at the cost of an increased number of tris.

    Method B saves a lot of tris in the model but, texture resolution depending, may result in rather coarse and blurred borders around the windows. What You prefer is Your choice; in my aircraft, I use method A.


    ad 3. Compulsory is too strong a word. But if You have a transparent part, You´ll want to have something behind it. If this is missing, You´ll end up with something like this:



    ...which looks weird and takes much off the models looks. Here´s a comparison how it looks with internal structure present:



    So yes, once You have openings in the model, be they covered with glass or not, You´ll want to offer the eye something to look at within.


    ad 4. You can just write whatever file name You like into the material, it needs not be there yet. The game can handle missing texture files quite well. If the map_albedo is missing, the model will be purple. A missing normal map will just result in a plain unstructured model. If the map_cblend_dirt_rust is not there, the model will age within seconds in the game and assume a rather apocalyptic look. And if the "metal_gloss_ao" is not found, the model will just show an uniform, not structured shine. But the game will not crash.


    That way, You can just build the textures one after another without having to provide dummy ones while work is still in progress.

  • Very nice. This method a to build separate mesh and addressing it with a material file with line "type= "PHYSICAL_TRANSPARENT" wihout the necessity of mapping nothing in alpha channel inside Blender look like very nice method! I wish to begin from this starting point to made my tests. When I achieved I return here and will post some result. Very very thanks! Regards.

  • I assume that the windows are a separate mesh. Assuming You use the mentioned PHYS_TRANSPARENT for the windows, the map_albedo of the material will have the RGB values en bloc define the windows colour, and the maps transparency will define the windows transparency. The map_metall_gloss_ao works just like with all other materials.


    If You have one of my models at hand, You can try "Scheibe.dds" for the albedo map and see how You like the result.

  • I assume that the windows are a separate mesh. Assuming You use the mentioned PHYS_TRANSPARENT for the windows, the map_albedo of the material will have the RGB values en bloc define the windows colour, and the maps transparency will define the windows transparency. The map_metall_gloss_ao works just like with all other materials.


    If You have one of my models at hand, You can try "Scheibe.dds" for the albedo map and see how You like the result.

    Yes of course: windows are a separe mesh as indicated this morning, also separate material file (that's pointed by the .mdl) with inside line "type =PHYS_TRANSPARENT". But I do not know about this maps transparency; you do not mention them before...

  • Seems we´re 99% there. The MGA map (metal, gloss, AO) has nothing to do with the parts transparency, that one just defines the parts shine/reflection. Everything about the transparency and the glass colour is in the albedo map, as mentioned.


    Please do try the attached file - it is in .tga format so it´s a bit more convenient to handle. Have Your glass material call it as map_albedo and see what happens. It should result in transparent, slightly blue-greyish windows. If You like it, convert it to .dds (with a non-digital alpha channel compression, i. e. DXT3 or 5)


    One more thing: in the transparent material, You´ll find the line "cutout=...". This can be either "true" or "false", You can try both and see which one You prefer. "false" gives a nicer texure imho, but will cover up a few material types behind it.

  • this is material file for wimdows separate mesh:


    "

    function data()

    return {

    order = 0,

    params = {

    albedo_scale = {

    albedoScale = { 1, 1, 1, },

    },

    fade_out_range = {

    fadeOutEndDist = 20000,

    fadeOutStartDist = 10000,

    },

    map_albedo = {

    fileName = "models/vehicle/plane/Scheibe.tga",

    type = "TWOD",

    wrapS = "REPEAT",

    wrapT = "REPEAT",

    },

    map_metal_gloss_ao = {

    fileName = "models/vehicle/plane/Scheibe.tga",

    type = "TWOD",

    wrapS = "REPEAT",

    wrapT = "REPEAT",

    },

    polygon_offset = {

    factor = 0,

    forceDepthWrite = false,

    units = 0,

    },

    two_sided = {

    flipNormal = true,

    twoSided = false,

    },

    },

    type = "PHYS_TRANSPARENT",

    }

    end

    "


    (I used the same Scheibe.tga for both textures (I think that this is no heavy problem)

  • Please try this material file instead.


    If this does not work, there are two other possibilities that can cause the windows to look like they do on the window.


    1. Please verify that the glass material is correctly assigned to the windows in the .mdl.

    2. Also check if Scheibe.tga is in the correct directory res\texture\models\vehicle\plane. The purple look of the windows in Your picture is usually an indicator that the map_albedo is not found by the game.