Tips of the Week

From Tech Artists Wiki

Jump to: navigation, search

Here is a list of all past and present Tips of the Week, organized into categories. Newer tips should go to the top of their respective categories.

MaxScript

  • Getting properties takes time (additional time for custom Parameters, and even more for Custom Attributes). If you must access them repeatedly, assign them to a variable.
  • Equality tests take time (though short). Try not to use "if <val> == true then" or "if <val> == false then". Instead, use "if <val> then" or "if not <val> then".
  • if <test> then is different than if <test> do - do does not take an else clause and will execute immediately in the Listener, while the former will wait for an else clause input and will appear to hang the Listener.
  • Instead of initializing an empty array and appending based on a test, you can just use
newArray = for <member> in <set> where <test> collect <member>

HLSL

  • The W component of a UVW is always available (just turn your float2 input TEXCOORD into a float3)- you can use it to store an arbitrary value (such as vertex alpha).
Personal tools