1. IntroductionCycles is a physically based rendering engine, meaning that is possible to create realistic renders using real world values, assuming you set things up properly. Smash 4 uses non physically based shading and lighting in order to render the game at 60fps and create a stylized art style. The Sm4sh Standard material is fast, simple, and simulates how models are rendered in game. The Sm4sh Toon material is for cel-shaded renders. The Sm4sh PBR material is a more advanced material that makes use of new shaders in Blender 2.79 and above. Scroll down to the bottom to find the download link.
1.1. Using Blender & CyclesThis guide assumes you have a basic understanding of how to use Blender, including the Cycles rendering engine and the node editor. If you're unfamiliar with Blender, I recommend finding tutorials online or watching these videos. Only minimal blender knowledge is required, so don't feel overwhelmed by all of the menus and settings of the user interface. You need to at least understand the following parts of Blender:
- importing a model from an FBX, DAE, or OBJ
- creating and adjusting lights
- creating materials and using the node editor
- adjusting render settings and scene settings
- basic viewport nagivation and keyboard shortcuts
1.1.1. Useful Keyboard ShortcutsViewport
shift + z: toggle rendered view
ctrl + alt + q: toggle quad views
middle mouse: rotate view
shift + middle mouse: pan
shift + a: add node menu
Cycles can simulate accurate lighting, but the results are often extremely noisy. Increasing the number of render samples decreases the noise, but also increases render times significantly. To reduce noise in renders, you can increase the sample count, blur the image in an image editor, or use the new denoising feature of Blender 2.79.
Under the Render Layers tab (next to render settings) in Blender 2.79, you can enable Denoising. After tiles are rendered, the algorithm will go back and remove the noise. You can change the radius or strength of the effect or change what light contributions are affected. The default settings are usually fine. Denoising is ideal for removing the last bits of noise from a mostly clean render. Using denoising with a very grainy image will result in black splotches and a blurry mess. With denoising enabled, you can use much fewer samples for much faster render times. Densoising requires additional time but is not as bad as increasing the sample count. 20 samples with denoising enabled is a good place to start. After 200 samples, the image won't look significantly cleaner for smash renders.
1.1.3. Filmic Color Management
Blender 2.79 added support for filmic color management, which allows for renders with more realistic highlights and dynamic range. The results will be more washed out, which can be corrected with curves adjustments in Blender or in an image editor. The Sm4sh Standard and Sm4sh toon material won't look correct with this setting, so use the Default setting (sRGB). For the Sm4sh PBR material, default or filmic will work, depending on the dynamic range of the lighting used.
1.1.4. Node EditorMaterials in Blender Cycles are edited using the Node Editor. In the materials tab of the mesh, make sure you have created a Cycles material. When you select the mesh, the material node graph will appear in the Node Editor. Each of the materials is a node group that connects to a material output node.
2. Sm4sh Standard v6
2.1. OverviewThe Sm4sh Standard NodeGroup is a non physically based material designed to simulate Sm4sh’s implementation of Blinn-Phong shading as closely as possible using nodes in Cycles. With minimal setup, you can plug in your material values from Smash Forge or Material Inject and create game accurate results. The material will only look correct in specific lighting setups and with the appropriate render settings, which are detailed in the Usage Information.
2.2. NodeGroup Inputs
2.2.1. Diffuse ColorThe diffuse map input is a color input for the diffuse shaders. Use your main color texture. No editing or color correction is necessary. The image texture node should be set to “Color.”
2.2.2. use Color Gain/Offset, Color Offset, Color Gain,The color offset color is added to the diffuse color. Use the RGB values for NU_colorOffset. Note that useColorGainOffset must equal 1 for this value to have an effect. This is due to the way materials with color gain and color offset handle diffuse color differently.
The color gain color is multiplied by the diffuse map color. Diffuse maps will always be converted to grayscale. Use the RGB values for NU_colorGain. Note that useColorGainOffset must equal 1 for this value to have an effect. This is due to the way materials with color gain and color offset handle diffuse color differently.
This value enables the use of ColorGain, ColorOffset, and specColorGain. 1 is enabled and 0 is disabled. This is a mix node, so values can be anything between 0 and 1, but you should never do this.
2.2.3. AO MapThe ao map is also a color input for the diffuse shaders. The ao map color and diffuse map colors are multiplied before connecting to the diffuse shaders. Save the AO map as a separate file to use proper gamma correction. A default value of white has no effect on the resulting diffuse color. AO maps will create more realistic ambient lighting when using ambient color. The image texture node should be set to “Color.”
2.2.4. AOMinGainThe AOMinGain color is added to the AO Map color. Use the RGB values from the material data. This should always be a solid color. If you want a texture, use the AO map input.
2.2.5. AO Mix FactorThis input controls the intensity of the AO blending. The specular and reflection colors are multiplied by the AO Map. The AO Mix Factor value mixes the AO Map with white before the specular and reflection colors are multiplied by AO. A value of 0 is no AO blending and a value of 1 is full AO blending. Use the Mix Factor value of AOMinGain (4th param).
2.2.6. AmbientThe ambient value controls the intensity of the ambient color. Ambient color is added to the resulting color from the diffuse and glossy shaders. The ambient color uses the diffuse x ao as the color of an emission shader. The ambient value controls the intensity of this shader. A value of 1.0 is the default. 0.0 has no effect. Turn this off for realistic lighting setups. Note that this effect will not usually create good results without using ambient occlusion maps.
2.2.7. Specular ColorThis controls the color and intensity of the specular highlights. Use the RGB values for NU_specularColor. A Beckmann specular distribution function is used for the regular and anisotropic specular.
2.2.8. Specular Color GainThe specColorGain color is multiplied by the specular color. Use the RGB values for NU_specularColorGain. Note that useColorGainOffset must equal 1 for this value to have an effect. This is due to the way materials with color gain and color offset handle diffuse color differently.
2.2.9. Specular Params ExponentThis value is based on the exponent value of NU_specularParams. You can use the values directly from the materials without any modifications. The exponent is converted to a roughness value for a Beckmann shader. Roughness works differently than the in game exponent value, so keep this in mind. The above image shows specParams values on the top and equivalent roughness values on the bottom.
2.2.10. Specular Color BlendThis value controls how much the specular color is blended with the diffuse map color. Use the Color Blend value from NU_specularColor or the 4th value if you are using material editing scripts. Higher values are more saturated and closer to the diffuse color. You may have to lower this value from the in game values.
2.2.11. Use AnisotropyThis value enables the use of anistropic highlights. A value of 1 uses an anistropic Beckmann glossy shader. A value of 0 uses a standard Beckmann glossy shader. This value should be 1 if the material uses NU_reflectionParams and does not have NU_specularParams. This is a mix value, so values can be between 0 and 1, but you should never do this.
2.2.12. Anisotropic Width/HeightThis value controls the width of the anisotropic specular highlight. Use the Anisotropic Width value of NU_reflectionParams. Values are between 0 and 1. Requires anisotropy to equal 1 to work.
This value controls the height of the anisotropic specular highlight. Use the Anisotropic Height value of NU_reflectionParams. Values are between 0 and 1. Requires anisotropy to equal 1 to work.
2.2.13. Fresnel ColorUse the fresnel color value from the materials. The fresnel color is connected to a diffuse shader, so fresnel only appears where the model is lit. You may need to make the fresnel color pretty bright for it to show up on brighter models.
2.2.14. Fresnel Params ExponentUse the first param of NU_fresnelParams. Higher values make the rim lighting tighter. Lower values make the rim lighting gradient softer.
2.2.15. Fresnel Color BlendThis value controls how much the fresnel color is blended with the diffuse map color. Use the Color Blend value from NU_fresnelColor or the 4th value if you are using material editing scripts. Higher values are more saturated and closer to the diffuse color.
2.2.16. Reflection ColorThe reflection color controls the intensity of glossy reflections. Improved color blending means you can use the in game values for NU_reflectionColor. Reflection Color simulates the in game cube map reflections. The roughness is set by default to 0.075 to create glossy reflections. You’ll usually only see this value used with metallic materials.
2.2.17. Use Sphere MapA value of 1 enables the sphere map color and 0 disables it.
2.2.18. Sphere Map ColorThe color of the sphere map reflection. The input should be the the sphere map texture node. Use the Sm4sh Sphere Map UVs node group as the texture coordinates.
2.2.19. Reflection Color BlendThis value controls how much the reflection color is blended with the diffuse map color. Use the Color Blend value from NU_reflectionColor or the 4th value if you are using material editing scripts. Higher values are more saturated and closer to the diffuse color. You may have to lower this value from the in game values.
2.2.20. Ramp StrengthThe intensity of the skin color effect. This controls the intensity of an emission shader. Use 0.1-0.25 for most things, including skin.
2.2.21. Ramp ColorThe ramp color input simulates the effect of the extra ramp used for skin shading. Cycles sadly doesn't support using ramps in this way, so the material uses a solid color. Red should be used for skin. The color is added uniformly to the entire model, similar to incandesce or self illumination. This has the effect of brightening and tinting the model and filling in shadows. Leave this at black unless you are doing skin, leather, wax, etc.
2.2.22. NormalUse a normal map node for this input, which can be found under vector>normal map. The normal input affects all the shaders, including fresnel. Be sure the normal map itself is set to non color data and first connected to a normal map node before being connected to the normal input. The image texture node should be set to “Non-Color Data.”
2.2.23. OpacityThe opacity input controls the transparency of the model. The “opacity” is the factor between the full material and a transparent bsdf. A value of 1 is totally opaque. A value of 0 is invisible. Plug the alpha channel of partially transparent textures into this input (hair for example). DO NOT USE THIS FOR NORMAL MAPS.
Another common use of the opacity input will be for textured expressions. Eye and mouth expressions often have alpha channels to render on top of the underlying face model. You may have issues with the opacity obscuring the underlying objects. For example, the area underneath a transparent mesh will have no shading. For the top object with the alpha channel, you can disable the diffuse rays in the object tab under Cycles Settings. Your layered models will now render correctly.
2.3. Usage InformationThe setup and usage of this material is very simple, but works slightly differently than traditional renders in Cycles. Note that this material requires very few samples to obtain clean renders, so renders will be very fast.
2.3.1. LightingI recommend using a directional light combined with an environment map or sky texture. A sun lamp of intensity 3.0 with a sky texture of intensity 1.0 is a good place to start.
2.3.2. Render SettingsAll light bounces should be set to 0 because the ambient lighting is done in the material itself. You shouldn't need more than 256 samples for renders. The view color space for the color management settings needs to be set to sRGB in order for the renders to look correct.
3. Sm4sh Node Groups
3.1. Useful Node GroupsThese node groups are helpful for converting in game materials and textures to values that can be used with Cycles nodes and shaders.
3.1.1. Blinn Exponent to RoughnessBlender Cycles uses physically based shaders with roughness inputs instead of exponents. This node converts the exponent of NU_specularParams to the closest roughness value.
3.1.2. OpacityThe shader input is the shader you want to mix with a transparent shader. An opacity of 1 is fully opaque. An opacity of 0 is fully transparent.
3.1.3. Sm4sh Base ColorUse this node group as the input for the base color of the principled shader or the diffuse shader. The textures and material values are converted to the total diffuse color. I highly recommend using this node group for more accurate results.
3.1.4. Sm4sh AO BlendCalculates the ambient occlusion blend to be used for specular, reflection, and fresnel. If Use Color Gain/Offset is set to 1, the luminance of the diffuse map is used instead of the ambient occlusion map. If you wish to use this value for your own shaders, use a MixRGB node set to multiply and the Fac set to 1.
3.1.5. Sm4sh Sphere Map UVsCalculates the texture coordinates for sphere maps. The mesh normal is transformed to eye space and then remapped to a visible range.
3.1.6. Sm4sh Tint ColorCalculates the tint color to be used for fresnel, reflection, and specular. The blend amount should use the color blend value.
3.2. Sm4sh Standard Internal Node GroupsThese node groups are used to organize the Sm4sh Standard material and have little use for other custom materials.
3.2.1. Sm4sh AmbientThe node group calculates a fake ambient color using an emission shader. The Ambient Intensity and Diffuse Color control the intensity and color of the emission shader, respectively. The shader will not illuminate other objects.
3.2.2. Sm4sh Anisotropic SpecularThe node group uses an anisotropic beckman shader. The width and height control the shape of the anisotropic specular. Use the 3rd and 4th values of NU_reflectionParams for width and height.
3.2.3. Sm4sh Color Gain Color OffsetThis node group calculates the diffuse color for material colored hair. If you want to use a game accurate diffuse color for your renders, use Sm4sh Base Color instead.
3.2.4. Sm4sh Diffuse + AmbientCalculates the total diffuse/ambient term for the Sm4sh Standard node group. I don' recommend using this node group separately.
3.2.5. Sm4sh Diffuse AOCalculates the total diffuse color based on the diffuse map, ambient occlusion map, and NU_aoMinGain. The Sm4sh Base color node group offers additional features.
3.2.6. Sm4sh Diffuse ColorCalculates the diffuse color for the Sm4sh Standard material. Use the Sm4sh Base Color node group instead.
3.2.7. Sm4sh Diffuse RampThe ramp is approximated using an emission shader. The ramp color is the overall color of the ramp (red for skin materials). For more physically accurate results, use subsurface scattering with the principled shader instead.
3.2.8. Sm4sh FresnelUses an emission shader to calculate the fresnel contribution. The Diffuse Color and AO blend inputs indirectly affect the overall intensity of the fresnel.
3.2.9. Sm4sh Fresnel TermCalculates the rim lighting effect using the normal and NU_fresnelParams exponent. The output can be used to mix two shaders or colors together.
3.2.10. Sm4sh ReflectionCalculates the reflection contribution for the Sm4sh Standard node group.
3.2.11. Sm4sh Render PassesA node group for organizing the internal node structure of the Sm4sh Standard node group.
3.2.12. Sm4sh SpecularCalculates the specular contribution for the Sm4sh Standard node group.
3.2.13. Sm4sh Specular Color GainMixes the NU_specularColorGain color with white based on whether the material should use color gain/offset or not.
3.2.14. Sm4sh Sphere MapCalculates the sphere map contribution. The sphere map texture should use the Sm4sh Sphere Map UVs node group for the texture coordinates.
4. Physically Based Rendering with Principled Shader
4.1. OverviewBlender 2.79 introduced the principled shader, a shader based on Disney's paper for PBR. This section covers the basics of realistic lighting and shading for renders of Smash models using the principled shader. The latest example scene download contains numerous node groups that can be used for a combination of physically based or stylized renders. These node groups can also handle the conversion from Smash material information to inputs of the principled shader.
4.2. Usage InformationOnly the base color closely matches the materials for Sm4sh models. The other parameters require manual adjusting to look correct. For materials with a second ramp, such as some skin materials, use SSS. The ramps are a cheap way of simulating the full subsurface scattering effect, which is much slower but looks much nicer.
4.2.1. LightingYou can use any lighting setup you would normally use for PBR renders. Examples include sun/sky, HDRI, mesh lights, or area lights. A single HDRI with a ground plane is the easiest to setup and produces good results.
The easiest option to create realistic lighting is to use an existing HDRI image.
Dynamic Sky is an addon for Blender that is installed by default in Blender 2.79. The results are much better than a typical sky shader and sun lamp, but renders are somewhat slower. You can create a dynamic sky by pressing "T" in the main 3d viewport to ensure the transform panel is visible and click "Create" under the Dynamic Sky tab. This generates a new procedural sun and sky system. Be sure to select the new dynamic sky in the world tab. The transform tab offers several adjustable parameters for the sun and sky.
4.2.2. Render SettingsThe Cycles default settings should work fine for most renders. You should have at least 2 bounces for diffuse, glossy, and transmission. Reflective and refractive caustics usually aren't necessary and can be disabled. 256-512 samples is still noisy but produces acceptable results. Don't render at a higher resolution than necessary to save on render time.
Under the color management tab of the scene settings, I recommend setting the View color space to Filmic. This produces a washed out image but much higher dynamic range and smoother highlights. The contrast can be added again within Blender or in an image editing program.
4.2.3. Mesh Artifacts and Lighting IssuesWith low poly models with smooth normals (most of Sm4sh), you may experience strange black banding artifacts around the edges of the model. The algorithms used for lighting in cycles don't work well with low poly models. The only way to deal with the shadow terminator artifact is to increase the geometry count with a subdivision modifier or use flat shading. Even with a few subdivision levels, there may still be artifacts that need to be painted over in post.
5. Downloads & Render ExamplesFolders containing more example renders and blender scene files for the NodeGroups are on the Google Drive links below. To add the materials to your current scene, go to File -> Append -> Node Tree. The PBR NodeGroup is in a separate scene file than the Sm4sh Standard and Sm4sh Toon.