Archive for year 2003

Enable Renderable Vertex Colors

Vertex colors do not render in the scanline or mental ray renderer by default in 3dsmax.  Nor is there a switch to enable them.  So, I built a script that tweaked the selected object or scene’s materials to allow this.

Interface Shot:

Material Change:

Results:

The screenshot above has a Advanced Lighting Radiosity pass baked down into vertex colors that were tweaked using the Vertex Color Tools Suite script to augment hue, control blending, and fix problem areas.

The render maintained the vertex colors, allowed over-brightening, and added cast shadows.

vConvex Hull Maker

Here are some screens from a convex hull maker script that I made as we began to integrate physics engines into our games and hence had the need for convex shells for collision calculations.

It was an interesting script to right.  I treat the source meshes as a point cloud.  I then start at any three points, build a face, and then randomly jump through all of the remaining points looking to the center to see if it can see any triangles.  It is sees one, it is concave and is deleted.  Then new faces are built.  Process is repeated until all the points have been run through.

Description:

  • This script builds convex hulls based on selected geometry.
  • Definition of a convex mesh: ”An object is defined as convex if, given any two points inside the object, you can always go in a straight line from one to the other without going out of the object.”

Usage:

  • Workflow:
  1. Select the object(s) that you want to build a convex hull around.
  2. Verify that the scope option in the script’s ui is set appropriately.
  3. Press the “Build Hull” button to create the new hull object(s).
  4. Select the new hull(s) and name them properly. (They will all be named “ObjectXX”)
  • Options:
    • Scope:
      • “Selection as single object”
      • “Individual Objects”
      • “Update Viewports”
        • This is a frivolous option that will allow you to watch the hull being built in the viewport.
        • Note this option drastically slows down the hull creation process.

Advanced Lighting Settings Utility

Description:

3dsmax had one of the first available tools for calculating radiosity and it did this at the vertex level.  So, we decided to make use of this for generating vertex color based lighting for our levels. The problem that quickly arose is that we wanted different light setups within the same level max file, i.e. one for a daylight exterior, another for a darker interior, and so on.

This script facilitates this by storing multiple radiosity and exposure settings coupled with associated geometry and lights.  It allows for batch processing one or more of these settings and where possible blending the vertex colors at transition edges, such as the threshold of a door.

Screenshots of the script’s gui:

Usage demonstration: