Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The actual work of this extension is done in intersect. This is the speed critical routine. Make every effort to optimize this function. Do not allocate memory in it. Avoid any OS and/or SDK function calls in this critical routine. Most of the memory and extension data structures whic which will be used during the render can be pre-allocated in initializeForRendering. If you want to access the global scene pointer, store it in initializeForRendering and use it later. This can save a huge amount of time.

...

These extensions can also have their own custom UV generators. These generators are declared using getNumberOfUVGenerators and getUVGeneratorNameusing getNumberOfUVGenerators and getUVGeneratorName. Once declared, they can be used normally with Cmaxwell::Cobject::addChannelUVW( dword uvIndex ) and Cmaxwell::Cobject::generateCustomUVW( dword iChannel, dword iGeneratorType ).The generators are implemented in getUVForChannel. This is also a speed critical function, so it must be optimized very carefully (no file I/O, no OS calls, no SDK calls...).

...