Continues from Semantics and annotations supported by the dx11Shader and glslShader plug-ins in Viewport 2.0.
Note: Currently not supported for the glslShader plug-in.
Name | Type | Description |
index_buffer_type | string | Allows specifying of custom primitive types via index buffer generator and mutator plug-ins. Usually used for tessellation, in order to provide the shader with an index buffer that contains extra data. The dx11Shader/glslShader project contains a mutator that can generate Point-Normal Triangles using Adjacent Edge Normals (PN-AEN) index buffers. See Customizing Geometric Data for Shaders in the Maya Developer Help. For dx11Shader / glslShader, use these values: no-value : default index buffer (default) "PNAEN9” / "GLSL_PNAEN9" : triangle and adjacent edges “PNAEN18” / "GLSL_PNAEN18": triangle, adjacent edges, dominant edges, and dominant vertices Any other value is acceptable as long as it matches the registered name of an index mutator. Corresponds to MHWRender::MPxPrimitiveGenerator. |
texture_mipmaplevels | int | The dx11Shader allows for you to control the number of mip-map levels that should be loaded or generated, either at the technique or texture description level. Use this annotation with your technique definition to specify the mip map levels that should be generated when loading textures while using this technique. The following values are valid.
To reduce texture memory, the default value for the dx11Shader plug-in is set to 1, so that only the first mip map level (<val>=1) is loaded / computed. It is also possible to enforce this on a per texture basis to explicitly reduce memory usage. Sample implementation as follows:
Can be combined with the parameter annotation mipmaplevels, in which case the latter takes precedence. See Texture specific parameter annotations. |
isTransparent (dx11Shader) | int | Specifies the opacity of the effect, allowing Maya to use proper passes and culling. Supported values are: 0: Technique is always opaque 1: Technique is always transparent 2: Opacity of the technique is tied to the float parameter that uses the "Opacity" semantic, and is transparent if the opacity value is lower than 1.0. |
Transparency (glslShader) | string | Specifies if this technique should be rendered in semi-transparency mode. "Opaque" : no transparency (default) "Transparent" : transparency is enabled. Corresponds to MPxShaderOverride::isTransparent(). |
SupportsAdvancedTransparency | string (bool) | Specifies if this technique supports advanced transparency algorithms (such as depth peeling). If true, the technique must define passes for draw context "transparentPeel", "transparentPeelAndAvg" and "transparentWeightedAvg". "false" : no advanced transparency support (default value) "true" : supports advanced transparency Corresponds to: MPxShaderOverride::supportsAdvancedTransparency() . |
OverridesDrawState | string (bool) | Specifies if this technique should follow Maya's transparent object rendering or is self-managed (multi-passes). "false" : does not override state (default value) "true" : self-managed Corresponds to: MPxShaderOverride::overridesDrawState(). |
OverridesNonMaterialItems | string (bool) | Specifies if this technique should be used to render non-material items such as the wireframe and the selected edges/vertices components. This is particularly useful for shading effects that compute displacement for which the object geometry will not match the rendered material, making selection difficult. "false" : does not override non-material items (default) "true" : used to render non-material items, so that the shader can display UI primitives See DrawContext in Supported pass annotations. Corresponds to: MPxShaderOverride::overridesNonMaterialItems() . |
ExtraScale | float | Specifies if this technique requires an extra scale factor to be applied to the object space bounding box. This allows the technique to indicate that the bounding box should be bigger than the base geometry; normally due to effects such as displacement, and to prevent the geometry from being discarded when moved to the edge of the viewport or during selection. Default value is 1.0. Corresponds to: MPxShaderOverride::boundingBoxExtraScale(). |
VariableNameAsAttributeName | string (bool) | Tells Maya to use the uniform variable name as the Maya attribute name (instead of the UIName, when present). "false" : use UIName as attribute name (default) "true" : use variable name as attribute name Can be used to maintain backward compatibility with a saved Maya scene, when the UI names defined in the shader file have been modified. |
handlesConsolidatedGeometry | string (bool) | When set to False, specifies that the Consolidate World feature should be disabled on the geometry to which the glslShader is applied. This annotation is useful when your technique draws displacement, the calculations of which involve the object-space co-ordinates of an object, such as use of the World transformation matrix. Consolidate World moves vertices of multiple objects into a new shared object-space, and maybe therefore cause your plug-in shader to render incorrectly. In this case, you may want to disable Consolidate World. |
The effect can request that some of the passes in the technique be activated in a specialized context, such as when drawing depth maps for shadows. This is done by adding a string annotation named "DrawContext", specifying the context in which the pass can be activated.
Name | Type | Description |
DrawContext | string | Specifies that this pass should be enabled only for this draw context. Multiple passes can have the same DrawContext value. This can be any string value that matches a pass semantic in MHWRender::MPassContext. For example, the following contexts are supported: "colorPass", "shadowPass", "depthPass", and "normalDepthPass". An empty value (or if DrawContext is not set) is equivalent to setting this annotation to "colorPass". Set to "nonMaterialItemsPass" for passes used to render non-material items. Set to “selectionPass” for passes used to select non-material items See OverridesNonMaterialItems in Supported technique annotations above. |
PrimitiveFilter | string | Specifies that this pass can handle the rendering of the following components: Can be used to handle edge or vertex components during the rendering pass or the selection pass. Vertex components are rendered as quads instead of single pixels, and edge components, mostly during pre-selection highlighting, are rendered larger, for better visibility. This is usually achieved by using a geometry shader to convert lines and points to quads. "fatLine" : this pass can render lines as quads "fatPoint" : this pass can render points as quads If there is no pass defined that handles this special case, the default pass that handles the draw context "nonMaterialItemsPass" or "selectionPass" is used. |
Name | Type | Description |
MayaSwatchRender | bool | Identifies when the current rendering process is used to draw the swatch. Allows the user to handle a specific path when drawing the swatch. |