Shader Interfaces

Deprecated

To realize the goal of providing inaccurate but fast previews, it is important to replace any software node with a hardware node, or omit it altogether, and still obtain a reasonable simplified image. Global illumination has no hardware equivalent, but a software shader that renders an object layer (such as the three object nodes in the above graphs) may have an equivalent or simplified hardware version. This requires that a shader interface is introduced that allows defining hardware and software shaders that provide a similar interface to the scene. The following intrinsic differences need to be abstracted:

Although the implementation is obviously different, both software shaders and hardware shaders accept parameters in a similar way. mental ray supports mapping standard mental ray shader parameters to uniform variables, unpacking information into a form that the hardware shaders can use:

Software shaders have no inherent limit on the number of lights and textures. Hardware shaders do, because the number of uniform variables, registers or number of instructions are rather limited. Effects that would exceed this limit require layering. For example, if there is only room for ten lights in the uniform variables but the shader's light list contains twenty, the shader must be called twice to layer the effect. The design does not attempt to automate this at this time because it is not known how lights and other parameters interact. If the shader fails to load, it will either render with a default hardware material or with rendered the software version.

Copyright © 1986-2008 by mental images GmbH