I've finally gotten around to porting the TGA PBL CGFX shader for Maya
to the new ShaderFX format for Maya(Works in 3DSMAX as well?). In essence this shader is very similar to the old one, but there are a few improvements.
Highlight features of this shader:
Ideas for future improvements:
- A real life material based fresnel term that alters specularity and reflections.
- A substance texture to mimic how materials reflect and refract light in real life.
- A roughness texture to define a materials surface structure(smooth/rough).
- Image based lighting via a cube map for reflections and ambient lighting.
- Roughness controlled sharpness of reflections using pre-blurred mip levels of the cube map.
- Linear shading pipeline. Albedo, roughness, substance, ambient occlusion and the cube map are converted to linear.
- Transparency support through the Albedo texture alpha channel.
- Energy conservation for light amount for both direct and ambient light.
- A bundled cheat sheet image with color swatches for several substance values as well as a bundled cube map to get started.
- SSAO and MSAA through the VP2.0 in Maya(not a feature of the shader itself).
- Optional Blended Normals diffuse lighting method for skin level SSS-effect along with option mask texture. New!
- Shadows with directional and spot lights. New!
- User defined amount of Maya native lights in viewport. New!
- Exposure and Gamma are tweakable in the viewport in Maya 2015 extensions1 for better overall contrast(not a feature of the shader itself). New!
- Tutorial video for getting started and using the shader.
- Alternative anisotropic specularity model
- Emissive Texture to simulate emissive surfaces.
- Multi-pass mode to get reflections on transparent surfaces to mimic glass like materials.
- DX11 Tesselation and displacement.
- Vertex color tinting.
- Some kind of SSS approximation other than blended normals(?). Maybe something like this?
- Haven't found a way to get cube map image size or number of mip-map levels to automatically handle this. User has to manually set cube map resolution/side. Default at 512px/side.
- Maya 2015 Service Pack 3(?) or newer. Run with DirectX as render engine.
- Maya 2015 LT(no info on this but has ShaderFX support)? Run with DirectX as render engine.
- Maya 2014 LT(no info on this but has ShaderFX support)? Run with DirectX as render engine.
- 3D Studio Max 2015(no info on this but has ShaderFX support)?
From 1.0 RC2 -> 1.0 RC3:
Using the shader in Maya:
- Added option to use Blended Normals for the diffuse ligthing. Comes with optional mask texture, weight slider and cyan suppress slider.
- The shader now handles not having textures loaded better. You now get meaningful results from whatever combination of textures you decide to load. As meaningful as it gets anyway.
- The "Use_Abledo_Alpha_as_Transparency" gave strange results when unchecked, not acts as intended and gets completely opaque when not checked.
- The Rotate Cube map slider is now at default value of 360 to force the slider to go from 0-360 range instead of 0-1 as before.
- Apply a ShaderFX material to your object.
- Open the ShaderFX editor through the material in the attribute editor
- File > Import Graph > point to the SFX file.
- Close the ShaderFX editor to show the shader attributes in the Attribute editor.
- Tip: Use MEL command "shaderfx -update" to easily refresh all the textures in the shader.
- Tip: Rename the .sfx file to "startup.sfx" and place it into "Documents\maya\ShaderFX\ Scenes". This will set the shader as the default shader graph to use for new ShaderFX materials.
This is the first public version of this shader. I will keep updating the shader continously with improvments, fixes and maybe a new feature or two. Please give any feedback you have in this thread. Thanks.
The code for light contribution(color & intensity) and shadows are blatantly copy pasted from the TraditionalGameSurfaceShader supplied with ShaderFX in Maya. Did not feel inclined to re-invent the wheel. Author of these snippets? Kees Rijnen?
The model and textures in the image above created by Ronja Melin, ronjamelin.com