Home Technical Talk

3dsmax5 vertexcolor tools release

polycounter lvl 18
Offline / Send Message
CrazyButcher polycounter lvl 18
greetings smile.gif

EDIT BEGIN
The plugin/script comob is out now, hopefully it is useful to some people. The plugin comes with sourcecode if someone wants to recompile it...

http://www.planetquake.com/polycount/cottages/crazybutcher/code/_3dsmax.html
EDIT END

as vertex colors/alphas are a mighty thing, ie in game you can blend between textures using them and such, I thought about making it a bit easier to visualize/use them in max.

I am on max5.1 so likely it got better on higher max versions...

anyway the idea is following:

vmap.jpg
1 plugin: a "extended" vertex color map, it allows the user to specify any UVW channel (or vertex color) to be used as color, also comes with a invert checkbox wink.gif

vcopy.jpg
2 plugin/script: to copy uvw/vcolor/villum/valpha to each other, essentially making it possible to use villum or valpha in the renderer, a little tricky by abusing a uvw channel but I didnt find a fast reliable way of accessing vertex alpha during rendertime in max.
it will also allow to read/write from individual coords (U,V,W or R,G,B)

it looks like the second one will be a plugin too, originally thought about making a max script, as it seemed easier, but it doenst look like its actually easier to access vertex illum/alpha from maxscript.

anyway any thoughts about the idea ?
the first one is already written, second one is just in the works. I did some search about vertexcolor/alpha tools but mostly they focus purely on the normal vertexcolors, there is a really nice maxscript "vcTools2" out there...
however most game engines would be RGBA per vertex not just RGB, and you could also send more data or encode into single channel to do fx... also as I wanted to do a bit more "gamelike" rendering with max materials I need a vertex alpha map.

if someone knows if this has been done before, please tell me, would save me some work smile.gif

Replies

  • JonMurphy
    Options
    Offline / Send Message
    JonMurphy polycounter lvl 18
    Good idea. Many studios already have scripts like this in place in their pipelines, but it would be 'a good thing' for new artists to learn and understand.

    A good script that may compliment what you are doing is one that toggles the use of vertex colours in renders (it can be a pain to set up all the materials in a scene this way). Found one here -

    http://www.jonseagull.com/downloads.shtml#toggleVCs
  • Eric Chadwick
    Options
    Offline / Send Message
    Hmm. I know vertex color is stored by default in UV channel 0. But where are illum and alpha stored? I don't think they can be in the same channel because there are only three numbers per vertex.. U V and W, which I guess correspond to RGB. Do you know where they're stored?

    In 5.1 I've been using a v4 modifier plugin called Copymap.dlm, which lets me copy UV channels within the modifier stack, very useful.

    You might get some usable ideas from this one.
    http://www.scriptspot.com/Main_Scripts.a...=vertex%20alpha
    Might be able to convert some of it from v6 code to v4/5...?
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    thx eric, but I guess I will stay in the c++ sdk, because it seems quicker and easier to access the vertex alpha/illum

    which actually have -1 and -2 as channel index. and alpha is simply just using the U coord.

    the toggle vc thing is nice smile.gif the problem is that I need more than one vc to do blends between material, hence all the work, mostly I surrendered on trying to create a vertex alpha/illum map, I couldnt get it to work, and dont know people who could help me on it (and sparks is too inactive), so I thought about "abusing uvw channels" to allow more per-vertex color fx.
  • Eric Chadwick
    Options
    Offline / Send Message
    We also found sparks to be a ghost town, had to rely on our own wits a lot. But searching the knowledge base did turn up some gems now and then.

    Cool to hear they're in -1 and -2, thanks.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    yeah eventually I go back to use maxscript for this now hehe
    didnt think it was just -1 and -2 as in sdk, cause maxscript docu didnt say anything about it...
  • CrazyButcher
  • Eric Chadwick
    Options
    Offline / Send Message
    Thanks for making this! I'll check it out.

    Does the modifier stack have to be collapsed to use the tool?

    BTW, John Burnett's MeshMan script was a really great tool for examining which UV channels are in use. But it only supports Editable Mesh, not Poly. Would love to see this updated to recognize EP, but footools is long gone, and the guy doesn't respond to email. Have you seen its UI? I guess max7's new layer manager thingy replaces it anyhow.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    nope dont have meshman, if you have it send it over and I take a look. I dont see myself buying max7 soon so...

    there is also a nice script by some other guy, who never replied either, that allowed "copy/paste +/- mirror" of keys like character studios copy paste, which I modified so that its easier to use (essentially added copy/paste buttons) but since its not my work and not sure if its okay with the guy who made it I dont know if I should release the changed version

    and no dont think one has to collapse, but the baseobject must be editmesh/editpoly.
  • Eric Chadwick
    Options
    Offline / Send Message
    Oops.

    DLL <C:\3dsmax5\xtraplugins\Map_Vertexmap\vertexmap.dlt> failed to initialize.

    Is this compiled with the max 5 SDK?
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    hm maybe me using vc7.1 for the compile which would mean the user needs to have the .net framework

    I will compile it with vc6

    EDIT:
    compiled with vc6 now try it... about the only thing I think that could be the reason
  • Eric Chadwick
    Options
    Offline / Send Message
    Hmm, looks like the model must be collapsed for the script to work. Worked fine on an Editable Mesh, just not with a bunch of modifiers on top.

    I sent MeshMan to your website mail address.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    probably depends how the modifiers affect the basemesh, I just quickly tried uvw maps and deformers which dont change facecounts, and there it worked. But yeah would surprise me if everything ran pixelperfect on my first public venture of this kind wink.gif
  • Eric Chadwick
    Options
    Offline / Send Message
    Thanks man, this is great, very robust for a first release! Both work fine now. I did feed it a hard test, changed vert count in the stack. That's one reason the modifier approach of CopyMap.dlm is great, totally independant of the base modifier.

    Odd, I can't figure out how to get the Vertex UVW Color map to recognize UVW channels >1, seems it only displays the contents of UVW1 in the viewport. Even when set it to UVW5 for example.

    Also, is it possible to allow the spinner to go to -2, so it can use the other vertex channels?
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    nope that's the sole reason I made the vertexcopy macroscript for. I cannot get a material to work that uses valpha/illum on render time.

    About the viewport, I dont think the viewport mesh has more than one set of uvw coords. But I havent invested much time into the viewport rendering code.
    Mostly because I will have an external app for the materialsetup for our engine, since it's opengl and 3dsmax viewports dont allow much opengl tech and artist friend uses c4d so external app is better for both of us hehe.

    btw I got the meshman script, it looks not too hard to make it useable with editable poly, mostly a "retyping" task, ie transform meshop to polyop smile.gif
  • Eric Chadwick
    Options
    Offline / Send Message
    I'm using OpenGL in the viewport, and I when I change UV channels in my material/bitmap, it changes in the view.

    Max sucks however when displaying multiple UVs per material... you only get one at a time. frown.gif

    Looking forward to that new Meshman!
Sign In or Register to comment.