FlattenVertexColors 

OptimizeVertexColors 

SmoothVertexColors

MaxScripts Release 0.11 Beta Source FOR MAX 3.1 or higher (12/4/2000)

Copyright (c) 2000 by Borislav Petrov, Bobo's Rendert**ls. 



WARNING! The Avguard AVG.DLX MAXScript Extension is REQUIRED when used under MAX 3.1
It can be downloaded from Scriptspot.com / Extensions library.

SHORT DESCRIPTION

FlattenVertexColors reduces the color vertices to the count of the mesh vertices (one vertex color per mesh vertex)
by averaging the multiple colors and storing only the average value. This will work great with smooth objects but will
cause smearing artifacts at hard edges. Developed for Alex McLeod.
OptimizeVertexColors reduces only the redundant color vertices sharing the same mesh vertex and using the same color value,
but keeps multiple color vertices per mesh vertex when containing different colors. Results on smooth meshes will be identical
to FlattenVertexColors, but hard-edged objects' appearance will be preserved.
SmoothVertexColors reduces only color vertices sharing the same mesh vertex when the mesh faces using them share a smoothing group,
but keeps multiple color vertices per mesh vertex when the faces are not smoothed. Results are similar to those from OptimizeVC,
but with the added ability to user-control which colors will be reduced by assigning smoothing groups. Developed for Brian Tate.

All scripts are based on similar code and are completely commented.
Please feel free to use the scripts or parts of the code for your needs.


USAGE

Version 0.11 (12/4/2000)
 
Object
Mesh 
Vertices
Color 
Vertices
Optimized 
CVertices
Optimize
Time (s)
Flatten
CVertices
Flatten
Time (s)
Plane
1681
9600
1681
46.359
1681
46.563
Sphere
114
672
114
0.515
114
0.5
Box
98
576
218
0.484
98
0.469
All results on a PII 400. YMMV.
 
 
Original Scene. After running OptimizeVertexColors
the scene looks EXACTLY the same (so no additional picture ;o)
Resulting Scene using FlattenVertexColors
Sphere and Plane haven't changed, but Box is smooth.
Assigned the same Smoothing Group on both sides of the box's edge.
After running SmoothVertexColors, the color vertices 
at the edge were reduced.


DOWNLOAD PACKAGE

Version 0.11 BETA Source