A new way to texture your shipsets! |

Hey, I found this cool software on the NVIDIA website called "Mental Mill Artist Edition" which lets you create "shaders" in a GUI. Shaders are basically like a fancy kind of texture built using a special programming language specific to graphics, so being able to create them in a GUI is really nifty! 
Now I've run into Mental Mill before, but I'd never figured out a way to integrate it with, say, Wings, so that you could create the shaders in MM and export them to Wings, and "bake" them onto a ship model as regular textures for use in SE5 (since SE5 doesn't support shaders).
But I finally figured it out... it's a BIT complicated, but it seems to work pretty well!
(Assuming you have an OpenGL 2.0 compatible video card that is! But if you're running SE5 that's *probably* not a problem
)
1. Create your shader in Mental Mill's GUI.
2. Export it to GLSL from the File menu. That's the OpenGL shader programming language. Yes, I know SE5 uses DirectX, but we're going through Wings here which uses OpenGL.
OK, now you have 2 files, "yourshader_f.gl" and "yourshader_v.gl". What to do with them? Copy them into your wings\plugins\autouv directory. (You'll need the Scorpius v0.98.37 version of Wings because the 0.98.36 version had a bug where these shaders don't work at all!)
Now there's still a few more steps - hang on, though, this will be pretty nifty! 
3. Create a text file in the autouv directory where you just placed the shader files. Call it "wpc_yourshader.auv" - the "wpc" and "auv" are important, otherwise Wings won't recognize the shader!
4. Place the following text into your newly created text file:
{name, "My Shader"}.
{vertex_shader, "myshader_v.gl"}.
{fragment_shader, "myshader_f.gl"}.
5. Look in the "yourshader_f.gl" file for the following lines:
//
// The following are free parameters of the shader
// that should be set by the application at runtime.
//
Take note of any lines immediately following that begin with the word "uniform". Those are parameters for your shader, and you need to map those to items in Wings' UI for the shader to be as functional as it could be.
6. For each of those lines, add a line to your new file along the following format:
{uniform, type, variableName, DefaultValue, "StringInGUI"}.
For instance, if you see
uniform float msl_Generator_checker_1_checkerSize;
you need to put something like
{uniform, float, "msl_Generator_checker_1_checkerSize", 0.2, "Checker Size"}.
Note that if you see a "vec4" you need to put "color" instead in your file, not "vec4", as the vec4 type is used to represent a color in RGBA format.
Don't worry, we're almost there! 
7. Open up the "myshader_v.gl" file and insert the following text above the "void main()":
varying vec2 w3d_uv;
varying vec3 w3d_pos;
8. Also in the same file insert the following text before the closing curly brace:
w3d_uv = gl_Vertex.xy;
w3d_pos = gl_MultiTexCoord1.xyz;
vec4 Position = gl_Vertex;
gl_Position = gl_ModelViewProjectionMatrix * Position;
9. On the line that looks like this:
tex_coord0 = gl_MultiTexCoord0;
change the second zero to a one:
tex_coord0 = gl_MultiTexCoord1;
K, now we can open up Wings and try this baby out! 
10. Load your Wings model and run through the AutoUV functionality to create a texture mapping for your model, just like you normally would before exporting it to GIMP for that tedious editing process. But instead of exporting to GIMP, select the faces you want to apply your shader to (or all of them if you only want to use the one shader), right-click in the AutoUV window, and choose "Create Texture".
11. You are now presented with a list of options. Choose a size for your texture, and in the second dropdown box you *should* find the name of your shader! Select it, then click on Options.
12. In the second options dialog, presto! You should find all those parameters you spent that time setting up earlier, ready for customization! (See, I told you setting them up was worthwhile!
) Set them to your heart's content, then click OK.
13. Click OK on the original options dialog, and wait a moment. WHOA! Is that... could that be?!? Did Wings just apply your *shader* to the model, and create a *texture* out of it??? And it looks so NICE on your ship! And you... you can REUSE the shader! On the other ships in your shipset! Instead of texturing them all again from scratch!!!
Isn't that just COOL???? 
Note: Once you have created a vertex shader (that's the "*_v.gl" file) you can *probably* reuse it for future shaders to save you the trouble of modifying the new generated shaders! 
The software is bundled with NVIDIA's "FX Composer" software, which is a free download:

Re: A new way to texture your shipsets!
Lots of Big talk and I see no Pics??? :>
Show us some before and after pics if you don't mind.




Now the question is, do I try to write it in Erlang (which I haven't used in a while, but which should result in code that would integrate nicely into Wings as a plugin, as well as mesh perfectly with the idea of "functional programming" that I'm using here - building programs not out of classes representing types of objects like "colors" but out of individual functions representing processes like "extract RGBA values from a color") or in C# (which I'm much more familiar with, but would not integrate into Wings and - unless I use the beta C# 3.0 - would not mesh well with "functional programming")...
Re: A new way to texture your shipsets!
Sounds like something to try out!
I'll let you know how it works in Maya/3dsMax.
Its a 217 meg download, pretty serious 'free' software tool if you ask me