• Blurring the line between real and virtual motorsports
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Texture Crossfades did not import...

Discussion in 'Bob's Track Builder' started by sevware, May 19, 2011.

  1. Sorry... Don't know what this is called.... but you know how in BTB terrain you can assign two textures to a triangle (or group of them), and then by selecting vertexes on either side, and adjusting the blend percentage, you could fade from one texture to the other?

    What should I study in the help files that would allow me to manually (re)do this in Max? [It's not there on the imported track (at least, visually).]

    Another question... I've looked all over, and cannot find a post I kept running into a few days ago. It described what to do if your materials import with incorrect shaders assigned, and black showing where transparency should be. I remember the src alpha / inv src alpha part.... just don't remember what shader to use with a simple single texture with alpha transparency.... (the import process assigned a shader with a cube and bunch of other stuff that probably shouldn't be there.

    As far as I can tell, no objects show any transparency or fades between textures now that the track is (gmt2) imported into max.

    Finally... If I want to be able to look at sub-material and texture stage names and know what I am looking at (rather than some ambiguous string).
    --Where are the proper places to change those names?
    --In the master slot dropdown?
    --On the submaterial buttons (?), or on the little single word window on their left?
    --Other than the texture file name, I seem to remember some name on the texture stages that is machine assigned in max. Can this be changed, so long as it is given a unique name?

    I would just like to know what (and where) I can change the name of... and which (if any) are assigned by the application that need to remain unchanged.

    I'd like to re-assign my own names to materials and textures so the names indicate what I am looking at.

    Thanks in advance..
  2. The shader is called, t1 lerp t2 (etc) vertex alpha. What that does is it blends t2 into t1 depending on the vertex alpha value.

    select the object > right click > Object properties > vertex channel display > vertex alpha
    in the rollout > vertex submode, scroll down and you will see vertex alpha value.
    Select the vert's you want to have blend, then set the blend value in the rollout.
    It's not as simple as btb and also once you have set the alpha, do not edit the terrain, If you do, you need to go into tools > channel info and clear the alpha and start again.

    Use the gmt wizard to reset your specular colours etc.

    You name your materials on the sub material button.

    Keep the material naming system in place, give your mat's nicknames in the box next to the sub mat. button..

  3. Thanks again, and also for the quick vertex alpha tut, Mianiak. I need to spend a day in max help learning the material editor tomorrow. I can't even make a flat panel image with alpha to be transparent in max (!).

    In the meanwhile, I re-imported my track... this time, just the track, terrain, and special objects (xsectors, start & pit lights, my 'copter, etc..). Everything else I need, I'll import or build when I need it.

    Much smaller and more manageable now.. I kept getting warnings from xp that it wanted to adjust my virtual memory up... Not any more.

    Do you know if the material editor ball is supposed to have anything in it? I've got one each for track, terrain, and objects, and it's a flat black panel (no ball in those 3 spots). (?)
  4. You need to enable the texture to be viewed in the viewport, get the track making tutorial from the virtual lm site I linked you to earlier, it explains how to setup the materials. The gmt importer messes a few things up, like specular colour for one. I usually refer to simed and go through the materials and fix them up.

    [ED] you wont see transparencies in max. You want to get used to using the scene viewer, once you get that working, it's just a few clicks to export the gmt, then load the track in the viewer and you can see how the shaders etc are working.
  5. Sorry... I keep getting ahead of myself.
    When you first pointed me to the virtua_lm tuts, I was still trying to understand importing.

    Now that I look at them, they are exactly what I need. I'll get at 'em.

    Thanks again
  6. No worries, btw I had another thought for you. If you have already imported the whole track but it's a mess, you can grab objects out of another .max file, then you don't have to go through the whole import thing again.

    Start a new project and go to import> merge (click on the arrow on the right of import) then select your previous max file and open it, then you can select individual pieces and load them into a new project.

    This is what I used to do before you taught me about containers, when the project file got too big, I'd start a new project and only import the bits I needed to work on.
  7. Good to know.... thanks.

    Alternatively, from what I read, you can also take the "c" off the end of the file extention of YourTrackSection.maxc container file, and load it (by itself) as a normal max file.

    I haven't tried this, but from my (limited) experience with containers, if you shut down unusually (you know... because of "undocumented features"), after rebooting, when trying to Load and Open a container, you sometimes get a "Time Stamp" out of date warning.

    The remedy for me was the Reload command (on one of the container panels).

    Meanwhile, I'm still trying to read about anything that will help me understand how to accomplish the 'normal workflow' processes ... building, texturing, export that I had become accustom to in BTB. Think I have most of it digested... except...

    On the subject of actually seeing what one is doing (feature that..), I've been googling about max viewport shaders, material swap scripts and the like. I haven't found anyone saying that it is not doable. Also looks like it's not safe to ask any questions about writing shaders... or young code weasels will be popping out of the woodwork to tell me how naive the question is.

    Probably should start thinking along the lines of some script that performs material swap-out and gMat update just prior to exporting. You would still need the game or viewer for true representations, but the goal would be to be able to model with bump, cube, spec, and transparency at a decent resolution in the max viewport.

    Looking through the first 20 pages of scriptspot, I didn't see anything. Makes me wonder how feasable this is. Certainly seems possible..... but, if so, youl'd think that someone would at least be selling such a script...

    Oh well.... more reading.
  8. I think I read somewhere you said you can code. I'm not really much of a coder, although I understand the principles and can get some things done. I have looked into maxscript to make a converter from standard to gmat. I ran a marco recorder and recorded setting up the gmat's. So those commands are easy to get.

    In laymans terms, what needs to be done is,,,
    submat = 1
    start loop
    If material is multisub and submaterial + %submat% is true then get the texture layers of (submaterial + %submat%) else goto eof
    -- then you need to figure out what type of gmat shader yoru using.
    If bump is true then remember bump
    if specular map is true then remember specular map
    if transparency is true then set src alpha 1 and inv src alpha 1
    etc etc, if you get my drift.
    increase submat by a value of 1 then go back to the start of the loop

    I think the hardest part of it is determining what type of gmat shader to use. Standard max shaders work differently and I don't think there is a way to translate from a standard shader things like the gmat multa and add maps.
  9. So... I wrote the ShaderFX support email address, and asked if viewport shaders for max can be made with their program. The answer was yes, and that you could get an approximation of a game's look.

    Knowing what max can do, something closer to what is in game seems possible.

    Here's my mostly ignorant, initial, (brute force) idea:

    First: Perhaps it would be possible to create a set of shaders similarly named to the rF shaders, and similar in functionality, and so, quantity also. This is the ShaderFX part of the work. Source could make this easier.

    The idea would be that during your max trackbuilding you would create multimats using these almost identical shaders (identical... aside from.. that they happen to work in max's viewport).

    Next: Write a plugin that has the format and functionality (almost exactly) as the ISI gMot exporter plugin.

    [Be nice if the only things required to get the xport plugin source were signing a nondisclosure and an AnythingYouDoIsOurs statement with ISI.]

    A. What the modified gMot exporter plugin would allow you to do is.. get your shaders from one directory for exporting (the rF shaders), but present the same library of materials (and settings) to max for the viewport except... pointing to the (almost) identical shaders you have written with ShaderFX.

    Otherwise, if the plugin source is not available...

    B. You could write a plugin to use the rewritten shaders for the max viewport which would look similar, and provide the same functionality as the gMot xport plugin.

    So.. you would track build in max creating a library of multimats that follows the required max xport form. The control surface in material editor would provide the same controls (parameters) as the gMats do per each of their shaders.

    When you were ready to export to game, you would need to run a maxscript which would go object by object, and create the (almost identical) gMats from you nMat library, and swap out the material for the newly created gMats.

    Since the form and format of both of these material types are virtual clones, a script should be able to make/remake a new gMot library of materials that would include any changes you made (and actually got to witness) while modding.

    As you can see... both methods require the cloned max viewport shaders, and the (hopefully) Visual Studio part of the work for the plugin.

    Having the existing source would mean almost cloning the existing shaders, and plugin, and so would be much faster. And cleaner.

    Not having it would mean writing everything from scratch, and additionally writing a maxscript to create & swap material types prior to xport.

    ShaderFX seems to have a healthy price.

    There's also the part about ISI completely changing all of this for rF2 at any moment..... where none of this may be necessary.(please) It would be easier to want to try this if the new version wasn't (maybe) close.