×
Menu

Making textures look good with The NetImmerse Shader (en)

 
Копипаста статьи из MaxImmerse.chm (С)

Go to the Material Editor in 3d MAX!
While Phong and Blinn materials are fully supported in MaxImmerse, you will get far more control by switching to the NetImmerse Shader under the Shader Basic Parameters dropdown of your material.
 
The Material section:
· Ambient and Diffuse colors work as they normally do in Max. The Diffuse color will affect your texture color so if you want only your texture values to show, set the Diffuse to white. The Specular highlight will only work if the flag is set to on and the shininess values is set just as you would with the Blinn or Phong shader.
· The Alpha value controls the overall transparency of your material if you have no alpha map loaded. 1.0 is opaque. 0.0 is completely transparent.
· Vertex colors must be flagged on to be viewed in NetImmerse. (For more on Vertex colors see above -“Shading with Vertex Colors”)
· Apply Mode is most often Modulate while Replace will ignore all lighting and Vertex colors. (Good for completely self-Illuminated textures.)
 
Transparency - SRCALPHA, INVSRCAPHPHA, INVDESTALPHA, WHAT?
· Automatic & Standard settings on the right of the material rollout will use the alpha channel in your texture or the overall Alpha value to do normal transparency. It will try to sort itself correctly with any other transparent objects in the scene.
· Additive transparency uses no alpha but instead takes the RGB values from your image and adds them to whatever is behind it. It will never make anything darker, just lighter. This is used mainly for effects such as laser blasts, fire, etc. It has little to no sorting issues and is relatively cheap to render.
· Multiplicative is just about the opposite, always modulating what is behind it and making it darker.
· Advanced allows you to customize the Source and Destination values to any other crazy DirectX mode you might want. I have not had much luck adjusting these values to anything other then default, automatic, standard, or additive. They do not seem very useful.
· None setting will let the material know to not worry about being sorted because its opaque.
 
Transparency Sorting tips:
A good example of a transparent Z-drawing issue exists in the MadLab Sound Room.
The window, with a transparent glowing sprite on transparent blinds with a glowing additive light behind it caused a good deal of ‘z-fighting’. The glow and the blind alpha were having trouble sorting since they are in almost the same place.
The blind alpha was finally set to Alpha Test and the glow was set to zMode10 to fix that problem. There are a few tricks to help with transparency sorting if you run into a problem like this.
· Right click on the troublesome object and bring up its Properties Dialog box. Switch to the User Defined tab place the tag ‘zMode10’ or ‘zMode00’. (‘ZMode11’ is the default transparency that tries to sort itself. It both reads and writes its position to the z-buffer.) ‘zMode10’ just writes and ‘zMode00’ does neither. I’ve had luck-setting things to zMode10 in many situations.
· Change the objects list in the hierarchy that gets exported to NetImmerse. Each object is sorted by its location in this list. In Max, there is no simple way to re-arrange this list that I know of, which is a pain. Things are ordered in max by 1) hierarchical grouping, 2) the creation date of the object. In Maya you can rearrange this list easily but I have had to attach or re-link objects to adjust their order in Max.
· If you have two transparent objects with the same center and they are not sorting right, move the pivot of one.
· An Object sorting itself out? NetImmerse only does object based alpha sorting. It cannot perform per-vertex alpha sorting within the object itself. In other words your “transparent U shaped glass space tubing” is not going to sort right looking though both sides of it. Now, a quick fix for this is to put zMode10 in the properties box. But then you might notice after you’ve established twelve of these space tubes in your level that the zMode10 property is now causing your tubes to draw over each other. The proper way to do a “glass with an inside” or a “transparent U shaped space tube” is to make it 2 objects.
 
Cutting things off with Alpha Testing:
Alpha Testing is one way to optimize some transparent effects. It is used for mostly for things that have a clean and high contrast edge like fences, windows or trees. It works like this; it looks through the alpha in your image and decides that anything above a specified value gets drawn at 100% opaque and anything below does not get drawn. In this case there is no in-between and the rendering is much faster.
This is what you need most often in a forest or a city with lots of decorative streetlights. The Test Ref spinner is what defines the cut off value from 0-255 (Dark to Light). The Test Mode rollout tells it weather to make opaque what is GREATER then that value or LESS then that value.
You will also see Greater & Equal, just Equal, etc. but you will find that the Default, GREATER is the setting you will use the most, as all values above the Test Ref number will render opaque and all below it will render “transparent”.
 
The Map Rollout:
The Map Rollout works the same as it always has in Max. The Base map is equivalent of the Diffuse Map in a Phong or Blinn material. It is the basic map that will show in combination with your diffuse material color. Make sure diffuse color is set to white if you want just your texture values to show. MaxImmerse ignores the bottom 4 map slots.
· Most of the map slots are self-explanatory, Dark is for any Dark-maps, Detail for Detail maps, etc. Note- you should be using different mapping channels and additional UVW maps for these textures or they might as well use Photoshop to composite them into the base texture. I.E. A detail map is no use unless it is tiled more than the base map it is on.
· The Gloss map is used mainly to tone down Environment and Bump maps. If you use an Environment map without a good Gloss map to tone it down you will get your standard “Super-Chrome” look, which is bit tacky to say the least. (Unless it’s on a T2000 of course.)
· Particle Color and Particle Age work great for sprite based particles and will affect their color and transparency as they age. These map slots have no effect on normal geometry or instanced geometry used in a particle system.
Digging down into the Map Coordinates and Parameters: the Noise & Output rollout is not supported. Under the Coordinate rollout, Mirror & Angle are not supported. Under the Parameters rollout: Crop & Place are not supported. All of these features can be accomplished using the UVW & UVW Unwrap Modifier. Also note that every object that displays a texture must have some sort of UVW mapping. Otherwise, it will show as white in the view port, appearing to have no texture applied.
 
A last word about map sizes:
Keep them small when you can. Big textures slow down real-time engines big time. This is especially true on the PS2. While the PS2 can load a 512x512 x 32-bit texture, it does so like a small snake trying to eat a big mouse real fast. It is not pretty. The big problem here is the small amount of memory that the PS2 has for textures.
Non-factor of two or non-square textures ARE supported in MaxImmerse but are not supported by most rendering hardware. Additionally, it makes managing all of the texture assets of your game more complicated in memory. We suggest keeping away from anything that is not a factor of two. This will cause excessive blurring on most cards. Real-time hardware likes a ‘factor of two’ texture. For example; 256x256 or 128x64, etc.