alCurvature shader

warhammer-curvature-400 (1).jpg

The alCurvature shader measures the local curvature of the surface. This shader is an easy way to add detail and realism to your shaders. In this short tutorial we will use the alCurvature shader to mimic a shading painting technique effect on a model of a lead figurine.

Layer alSurface Shaders

An alLayer shader is used to layer two different alSurface shaders. We will use one alSurface shader for the black paint layer and another alSurface shader to represent the exposed metallic surface underneath.

  • Create an alLayer shader and assign it to the object.
  • Create an alSurface shader and rename it Black Paint. Connect it to Layer 1 of the Layer shader.
  • Create another alSurface shader and rename it Metal. Connect it to Layer 2 of the Layer shader.

alCurvature Shader

  • Connect the alCurvature (Outcolor R) to the Mix attribute of the alLayer shader. This will control the blending between the two alSurface shaders.
  • You can use the Radius attribute to pick out finer details in the figurine model. The default value of 1 is too large for our model. Reduce it to around 0.01. The images below show the effect this has on the alCurvature shading.

alcurvature.jpg

Untitled-1.jpg

Final shader network

 

INSIDE

Inside is a work of art. Pure poetry. Just a perfect 10 out of 10 game. So good, I just had to make this blog post to share how I feel about it. I have played it through four times now and every time I play it, I discover something new about it. Its a visually rich experience, with incredible lighting, sound and atmosphere. The puzzles are just the right difficulty and the ending is wonderfully bizarre.
Just a warning, if you start playing this game you will not be able to stop (and nor should you).

 

alCel Shader

alcel.jpg

alCel

Cel shading is a rendering technique used to simulate the lighting in cartoon animation. In this short tutorial we will use the alCel shader to apply a cel shaded look to the skin of an anime style character.

  • Start off by assigning an alCel shader to the skin surface of the model.
  • Create an alSurface shader and connect it to the Surface Shader attribute of the alCel shader. We don’t want to add any specularity to the toon shading so reduce the Specular value to 1.

Ramp

  • Create a ramp texture and connect it to the Diffuse Ramp attribute of the alCel shader. Change the Interpolation to none. This will give a toon like shading effect. Create a colored gradation similar to the example below.

ramp.png

The final shader network should look like this:

shader-network.png

alCel: Diffuse Strength

We can adjust the toon shading effect using the Diffuse Strength. This attribute acts as a multiplier on the diffuse component before being passed through the ramp.

diffuse-strength.jpg

alSurface Diffuse Color

A simple way to tint the skin is to apply some color to the Diffuse Color of the alSurface shader. This will give the model a quick and easy tan!

image2016-9-1 12-33-12.png
Color tint added to Diffuse Color of alSurface shader

 

That concludes this tutorial on how to create a toon shading effect using the alCel shader.

alcel.gif

AlJitterColor shader

image2016-8-11 14-43-40.png

The alJitterColor shader is useful for applying random color variation to scenes containing many objects. In this short tutorial we will add some variation to the hue and gain of some lemons using a combination of the Utility and alJittercolor shaders.

  • Start off by assigning an alSurface shader to the lemons.

Utility Shader

  • Create a Utility shader and change its Color Mode to Object. This mode uses the name of the shapes to compute the color (this is necessary because the Signal attribute of the alJitterColor shader requires a unique value per object). Change the Shade Mode to flat.

image2016-8-11 12-58-42.png

Utility shader set to ‘Object’ Color Mode

 

The Utility shader outputs values between 0 to 1. However, the alJitterColor input uses in values which are non float values. Therefore we will need to multiply the output value of the Utility shader to a larger number.

  • Connect the Outcolor R of the Utility shader to the Input 1 attribute of a multiplyDivide node. You will also need to increase the Input 2 to a higher value. In this case we have used a value of 80.

image2016-8-11 13-46-35.png

Utility shader connected to Input 1 of multiplyDivide node

 

  • Connect the Output of the multiplyDivide node to the Signal attribute of the alJitterColor shader.
  • Connect the lemon texture map to the Input of an alJitterColor shader.
  • Finally, connect the Out Color of the alJitterColor shader to the Diffuse Color of the alSurface shader. 

image2016-8-11 12-43-0.png

Final shader network

AlJitterColor Shader

Now that everything is connected correctly, we can have some fun adjusting the hue of our lemons. Before starting, reset the values of the alJitterColor shader.

Min Gain
  • We can use the Min Gain to apply a minimum random gain to the lemons.
min-gain.jpg
Min Gain: 1 (left). Min Gain: 0.25 (right).
Max Hue Offset
  • We can also use the Max Hue Offset attribute to randomly adjust the hue of the lemon texture. In this case we only want to make a subtle adjustment and so a small value of 0.05 was used.

image2016-8-11 13-50-55.png

‘Max Hue Offset’ of AlJitterColor used as a hue shift for the lemon texture

max-hue.jpg

Max Hue Offset: 0 (left). Max Hue Offset 0.05 (right)

 

That concludes this tutorial on how to use the alJitterColor shader to randomly change the hue and gain of a color texture map.

The MtoA shader is available here.