The following are the attributes for the node, with the AutodeskUberShader.fxo shader file assigned.
In order to use this shader, you must be working in the DirectX 11 environment in and have the dx11Shader.mll plug-in enabled. For more information, see Using DirectX 11 with Viewport 2.0.
You can find the in the Create bar. The AutodeskUberShader.fxo file is automatically loaded when the shader is created.
The dx11Shader.mll plug-in allows you to load and view your own HLSL shaders in Maya Viewport 2.0. When you create a DirectX 11 shader using the , the AutodeskUberShader.fxo file is automatically connected; however, you can also load your custom HLSL shader instead. Alternatively, other sample HLSL shaders are available at <maya directory>\presets\HLSL11\examples\.
The dx11Shader_defaults preset is provided. You can use this preset to revert the parameters back to the values initially compiled with the shader.
Tip
If you load a legacy scene from Extension 1 or 2 for Maya 2013 that uses the MayaUberShader.fx or .fxo shaders, your shader settings are lost and all values are reset to default.
To workaround this issue, you can edit your shader code by adding the following annotation to your shader technique: bool VariableNameAsAttributeName = false;
As an alternative, you can also substitute your dx11Shader file with the version of MayaUberShader.fx/.fxo that is shipped with Maya 2014 to regain the shader attribute values.
Gamma correction
If you enable under the tab and enable under the dx11Shader , gamma is only applied once and your shading renders correctly.
You can use the semantic MayaGammaCorrection to query if gamma is enabled in the viewport.
Using the _MAYA_ macro
If you share your HLSL files with other applications but need to include Maya specific code, you can wrap your HLSL code in
the _MAYA_ macro, similar to the example below:
#ifdef _MAYA_
float2 UV = float2(U, 1.0-V);
#endif
TipTo override the automatic loading of the AutodeskUberShader.fxo file, you can go to and set the effects file that you want to load by default.
NoteThe following lists the attributes of the AutodeskUberShader.fxo file. Attributes under the section of the exists for all DirectX 11 shaders. However, the options available may be different. For example, all DirectX 11 shaders have
a lights attribute, but the choices for the number of lights or type of lights may be different. Attributes under the section are specific to the AutodeskUberShader.fxo file.
Shader
-
-
Navigate to your shader file to assign it to your .
The searches for the .fx files in the following locations and in the following order:
- `workspace -q -rd`
- `workspace -q -rd` + "/renderData/shaders"
- `workspace -fre shaders`
- `getenv("DX11SHADER_ROOT")`
- `getenv("DX11SHADER_ROOT")` + "/shaders"
- ${MAYA_LOCATION}/presets/HLSL11/examples
The ` denotes executing either a MEL or C function to obtain the required value.
NoteThe AutodeskUberShader.fxo file, as well as other sample HLSL11 shaders, are provided in <maya directory>\presets\HLSL11\examples\.
Click to reload your .fx file and to edit it in your default text editor.
-
-
These options provide different shading methods within the same shading material.
NoteThe following lists the different techniques for the AutodeskUberShader. Different shaders have different techniques to achieve
a variety of effects.
TipYou can change the technique for multiple dx11Shaders in one step by using the , or by setting the value in the . Use integers to set the values in the . = 0, = 1, and =2. This shortcut is only applicable to changing multiple instances of the same fx shader.
-
: This is the default option and simply displays the mesh in the workspace without any tessellation.
-
: This option uses shading level tessellation to provide a smoother model without the need for extra geometry.
-
: This option provides a wireframe version of the tessellated mesh so that you can review the tessellation of the feature.
Light Binding
- / /
-
If you select the option, Maya automatically assigns the lights in the scene to the shader. If there are less than three lights in your scene,
then light 1 and/or light 2 are left unbound until a new light is created. If this option is selected, Maya indicates the
light that is bound for each of / / .
Use the navigation icon to access the connected light shape .
You can also select to refrain from binding a light. This way, you can tweak the light properties via the / / attributes in the DirectX 11 Shader .
You can also manually bind your lights. Select, from the drop-down list, the lights from the scene that you want to bind the
shader to.
Currently, the AutodeskUberShader supports 3 point lights, spot lights, ambient lights or directional lights.
ImportantAfter binding a light, you cannot change its parameters in the dx11Shader . Instead, you must make changes from the light .
NoteWhen the is loaded, Maya automatically binds the lights that are set to . All parameters sharing the same Object attribute are considered to define one light. If a specific light keyword, that is, ambient/point/spot/directional, is found in the Object attribute string, then Maya connects the first light of this type found in the scene. Once this is done, any unconnected
lights are connected to remaining scene lights based on position/direction parameter compatibility.
Tip
If you select under , and you have more than one ambient light in your scene, then all ambient lights in your scene are merged as one for viewport
rendering, and only one of // indicates Ambient as a result.
If you manually bind the ambient lights, then each of the manually bound individual lights are specified under //.
Parameters
Lighting
-
-
Disable this option to refrain from correcting gamma in the textures. Enabling this option assumes that the textures have
gamma applied and therefore removes this gamma and re-applies it later on.
-
-
Select this option to enable shadow casting.
-
-
Use this slider to control the intensity of the shadows.
-
-
Sometimes, real-time shadows can cause artifacts on your objects caused by limited precision in the shadow map or differences
in scene scale. Use this attribute to remove shadow artifacts on your object.
-
-
Select this option to reverse the backfacing normals of a double-sided, transparent object to improve its lighting.
NoteWhen this option is enabled, backfacing polygons caused by negative scaling may turn black. You should reverse vertex normals
after scaling negatively.
- / /
-
Use these options to simulate a rim light in your scene to highlight edges of objects. Use and to set the falloff from bright to dark. is the distance from the edge at which falloff begins. is the distance from the edge at which the falloff ends.
Light 0
-
-
Select this option to enable the specified light in the shader.
NoteThe following parameters are repeated for Light 0, Light 1 and Light 2.
-
-
Select the type of light, for example, spot, point, directional or ambient. The and options are used internally by the
dx11Shader.mll plug-in. Selecting either of these options results in a point light.
-
-
Use this attribute to set the position of the light.
NoteIf the light is not bound to a Maya light, you can
to manually connect existing lights, cameras, locators and so forth to this attribute.
NotePress 7 for scene lighting.
-
-
Customize the color for your light. Click the swatch either to change the light’s color in the or to map a texture to the light.
-
-
Use this attribute to set the brightness of the light. A light with an intensity value of 0 produces no light. A light with
a negative intensity value removes light from a scene in the area of the light’s influence.
-
-
Use this attribute to set the direction of your light.
-
-
Use this attribute to set the cone angle for your spotlight. This is the angle (in degrees) from edge to edge of the spot
light’s beam.
-
-
Use this attribute to set the penumbra angle for your spotlight. This is the angle (in degrees) from the edge of the spot
light’s beam over which the intensity of the spot light falls off linearly to zero.
-
-
Use this attribute to control how quickly the light's intensity decreases with distance. For more information, see
Decay Rate.
Ambient and Emissive
-
-
Enable this option and connect a file texture to to apply an emissive texture that is bright like a light source. To stop using the texture, disable .
-
-
Use this attribute to control the amount that the emissive map contributes to the shader.
- /
-
Use these options to brighten the object by simulating light coming from the ground or sky.
-
-
Select this option to add ambient occlusion to your scene. Connect a pre-baked map that affects only ambient light in the
shader.
Diffuse
-
-
Select among three diffuse shading methods, depending on your object. Select so that the diffuse lighting on an object is more realistic for simulating skin. Select to simulate the diffuse lighting for hair. Select for other models.
- /
-
Select to apply a diffuse texture to your object to tint it. Connect your texture to the attribute. Select to apply the texture's alpha information to the opacity of the object.
NoteUse of the with is currently not supported.
-
-
You can also tint your object using .
-
-
Select to apply a baked shadowmap. The shadowmap is then multiplied with the diffuse to create baked shadows.
-
-
Use this option to apply different amounts of blended normal diffuse to different parts of the object.
-
-
This option is a blended normal diffuse. Increase this value to create the light bouncing effect, softening the appearance
of the skin.
-
-
Use this feature to add image based lighting to your scene. You can connect a .dds cube map or a 2D spherical or latlong map; or, a combination of a cube map and a 2D map.
This feature allows you to rapidly prototype your character in different lighting environments.
-
-
Select this option to connect a
.dds cube map.
-
-
Select this option to connect a 2D spherical or latlong map.
-
-
Select from the drop-down list the type of IBL map(s) that you are connecting. You can connect a
.dds cube map or a 2D spherical or latlong map; or, a combination of a cube map and a 2D map.
-
-
Use this slider to increase or decrease the intensity of your image based lighting.
-
-
Use this slider to blur the image based map.
-
-
Use this slider to rotate your IBL map; for example, if you want the sun in your IBL map to appear elsewhere on your object.
-
-
Adjust this attribute to reduce pinching artifacts that may occur with some spherical maps.
Opacity
-
-
Use this attribute to control the transparency of the object.
-
-
Use this attribute to apply a texture that specifies the areas of the object that are fully transparent.
-
-
Use this attribute to set the threshold below which the pixels in the opacity mask become fully transparent. For example,
if set at 0.5, all pixels in the opacity mask with a value smaller than 0.5 become completely invisible.
- /
-
Use these attributes to adjust the opacity of the object based on the viewing angle. Use to adjust the opacity for faces that are parallel to the camera and to adjust the opacity for faces that are perpendicular to the camera.
Specular
-
-
Select among three specular shading methods, depending on your model. Select to perform Kelemen-Szirmaykalos specular calculations to better simulate human skin. Select to add anisoptropic specular lighting to simulate metal or hair. Select shading for other models.
-
-
Select to increase or decrease the amount of specularity on the object based on the values in the texture. The RGB channels in the
specular map controls the , while the alpha channel in the specular map controls the .
-
-
controls the brightness and color of the specularity.
-
-
controls the shape of the specular highlight.
-
-
If you select the option under , you can optionally add a directional map to control the direction of the anisotropic highlight. If you do not select this
option, you can still use the and options to control the color and shape of your specular highlight.
NoteCurrently, you must use a tangent space map.
-
-
Select from the drop-down list the type of direction map you are connecting to the attribute.
-
-
Use this option to control the color of your specular highlight.
-
-
Use this option to control the shape of your specular highlight.
-
-
Select this option to blend between Blinn and anisotropic specular lighting based on the alpha channel in the direction map.
Normal
-
-
Select to simulate the lighting of bumps and indentations from the details baked into the normal map.
-
-
Use the option to change the height of the bumps in the normal map texture.
-
-
Select this option to correctly display normals for objects that have non-uniform scaling applied.
- /
-
Use these options to set whether the red and green channels of your normal map are positive or negative.
ImportantFor this option to work correctly, you must ensure that is set to under the shape node.
Reflection
-
-
Select this option to use a reflection map in your scene.
-
-
You can connect a
.dds cube map or a 2D spherical or latlong map; or, a combination of a cube map and a 2D map. Select from the drop-down list the
type of map(s) you are using.
-
-
Select the option to include reflection in your scene. A allows you to create more realistic pre-baked reflections. Use this option to connect a .dds cube map.
TipYou can generate cube maps using freely available third party tools.
-
-
Select this option to connect a 2D spherical or latlong map.
TipIBL and reflection maps should be in the same color space as your other input textures. When using the setting in the AutodeskUberShader, input textures are expected to be in sRGB display space; therefore, IBL and reflection
maps that are not in sRGB color space should be converted into this space through image editing software.
-
-
Use this slider to adjust the intensity of the reflection on your object.
-
-
Use this option to create a blurred reflection effect. This option gives you more control over the type of metal or material
you are trying to simulate.
-
-
Use this option to rotate your reflection map.
-
-
When using spherical reflection maps, you can use this option to reduce the pinching artifacts that some spherical maps may
exhibit.
- /
-
Use and to adjust the amount of reflection based on whether a face is parallel to or perpendicular to the camera.
Use to add more reflection to the faces of the object that are facing the camera.
Use to add more reflection to the faces of the object that are perpendicular to the camera.
These options work best for curved objects.
-
-
Use these options to apply a texture to mask areas to prevent them from receiving reflection.
-
-
Enable this option to use the alpha channel of the specular texture to determine the amount of reflection needed to blur parts
of the object. Disable this option to evenly blur the reflection everywhere on the object.
-
-
Enable this option to use the specular color to tint the color of the reflection. The reflection map is not tinted if this
option is disabled.
-
-
Select this option so that areas on the object that have reflection or specularity do not become fully transparent (for example,
like a soap bubble). When disabled, reflections and specular lighting do not affect opacity (for example, with semi-transparent
objects such as hair).
Tessellation and Displacement
NoteYou can export texture maps from Mudbox to Maya in the following formats: PNG, JPG, BMP, TIF, TGA, EXR.
TipEXR is the preferred format for displacement maps and vector displacement maps.
NoteWhen working with deforming meshes, if you experience triangles/patches flipping, you can workaround the issue by setting
the attribute under the section of the shape node to or .
-
-
Select from the drop-down list whether you are using a greyscale displacement map or a tangent vector map. You can create
vector displacement maps in Mudbox. However, you must use the same low polygon model in Maya as you do in Mudbox.
When using a vector displacement map, you usually also want to provide a normal map to the shader to provide the correct
normals to the shader after the vector displacement map has moved the vertices.
Note
When creating a new scene in Maya 2014 / Extension 2 for Maya 2013, if you are using .exr files for greyscale displacement maps, you do not need to adjust the or values and the default settings should work automatically. If you are using .exr files for tangent vector displacement maps, you should set your to 0 and your to 1.
However, if you have a legacy scene, you must adjust your height and offset values to achieve the same result as in Extension
1 for Maya 2013. In general, you should set the to 1 and to 0 for tangent vector displacement maps and to 1 and to 0.5 for greyscale displacement maps.
This does not apply to .tif files. Therefore, when creating a new scene in Maya 2014 / Extension 2 for Maya 2013, you must adjust the or values manually. However, if you have a legacy scene, the same settings from Extension 1 for Maya 2013 should also work for
Maya 2014 / Extension 2 for Maya 2013.
NoteSelect as your if you output your normal map from Mudbox. Select as your if you output your vector displacement map from Mudbox.
-
-
Select to use displacement maps. Displacement maps extrude or indent vertices of your mesh. Displacement maps are especially useful
when used in combination with tessellation to generate additional details in your object.
The benefit of displacement maps over normal maps is that shadows pickup the new details of the displacement map.
-
-
Select the correct displacement axis for vector displacement maps. The axis is determined by the application from which you
generated the vector displacement map, for example, Mudbox.
-
-
Use this attribute to scale your displacement.
-
-
Use this attribute to control the base value for your displacement.
For example, if the offset is set to 0.5, a gray color is not displaced. An offset of 0 would produce an indentation. An offset
of 1 would extrude.
Likewise, if the offset is set to 0, a black color is not displaced. An offset of 0.5 would extrude half as much as an offset
of 1.0. Indentations do not occur.
-
-
In cases of extreme displacement, Maya may clip away faces inadvertently. This may occur in scenes with a landscape or objects
that are long and wide. Use this attribute to set the maximum displacement to determine when a face of an object is clipped
from view. You can also use to avoid inadvertently clipping your object.
-
-
Use this option to control the bounding box to avoid inadvertently clipping your object when displacement is used.
-
-
When you set this attribute, tessellation is controlled by the distance of the object from the camera.
NoteYou may find it easiest to enable when adjusting the tessellation settings.
-
-
Value of tessellation that is constant throughout the mesh. A value of 1 means no tessellation.
Increase the value to increase the resolution.
-
-
Select this option to blend point normal tessellation (which smooths the edges of the object) with (which only tessellates but does not smooth the object). Set this value to 1 to disable the smoothing.
Translucency
-
-
The feature simulates light passing through an object. For example, if simulating human skin, the skin becomes more red. Select
this attribute to use the options below.
NoteUse these options to add translucency to your object. This option simulates light passing through the object to give it a
more realistic look.
-
-
The is a texture you render to control the amount of light that passes through certain areas of the skin. For example, non-bony
areas with thin skin like the nose would have a reddish color, since a lot of translucency is coming through. By contrast,
bony areas would have a darker color in the thickness texture.
-
-
Use this value to set the amount that the normal (per pixel) influences the translucency.
If set to 0, the translucency is uniform over the entire object.
If set to greater than 0, for example 0.5; the translucent effect is no longer uniform but is instead broken up and distorted
based on the normal. The result appears more organic.
-
-
Use this attribute to change the focus or size of the translucent areas.
-
-
Use this option to adjust the amount of translucency created by the light behind the object. When you adjust the slider to
0, there is no translucency in your object.
-
-
This attribute sets the amount of translucency that an object always has, even if there is no light behind it.
- / /
-
Use these options to change the skin translucency color; for example, for a creature with different colored skin.
UV
You can bind a UV set to each of your texture maps. To do so, you must first bind the UV set to the . You can bind up to 3 UV sets under the Surface Data section. Map your UV set to each of where applicable. You can then use this drop-down list to select the texture co-ordinates (in other words, UV set) that you
want to map each texture map to. See Assigning a UV set to a texture map connected to the DX11 AutodeskUberShader for more information.
NoteThe section of the is specific to the AutodeskUberShader. However, the and features are general to all effects shaders.
Surface Data
This section specifies the channels of the geometry, such as normals and tangents, that are passed into the shader. for the available options.
By default, is mapped to UV set map1 and is mapped to map2 and so forth. If you use UV sets with different names, you can bind them to the shader by specifying them in the fields. Use uv: in front of your UV set name. For more information, see Assigning a UV set to a texture map connected to the DX11 AutodeskUberShader.
Default Texture Data
Use these options to select the default texture displayed in the when a UV set is selected. For example, if UV map1 is mapped to , and is mapped to , then when you select UV map1 in the , the texture is displayed.
Supported image formats
The following image formats are supported by the DX11 shader in Viewport 2.0:
- Bmp
- Cals
- DDS
For DX11: See the June 2010 version of the Microsoft DirectX SDK documentation for list of supported formats.
NoteAn error message may appear when loading certain .dds files, as the Maya software renderer cannot render the swatch. However, the formats listed in the DirectX SDK documentation
mentioned above render in DX11 mode in Maya.
- Exr
The texture node maps floating point values to values between 0-1 for its swatch display and DG evaluation. However, Viewport
2.0 may directly support floating point values without tone mapping. For .exr and .dds files connected to texture nodes that are mapped to the attributes of the DirectX 11 Shader, floating point bit depth is supported in the viewport.
- Flic
- Gif
- HDR
- Ig4
- Jfif
- Pcx
- Pict
- Png
- PSD
- Rlc
- Spot
- Targa
- TIF
Only fixed point bit depth is supported for tif files. Use exr files instead for floating point displacement maps.
- Any other image formats not listed above are read as fixed point bit depth in the DirectX 11 Shader node.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License