I just finished an OSL shader that blends together normal maps in a better way than standard overlaying.
Like so: Blending in Detail
Save the code below as mixNormalMaps_tx_v001.osl or unpack the attached ZIP. Then create a VRayOSLTex (not Mat) and load in the OSL file, then plug in your maps.
If you need to blend in more maps you can just duplicate the OSL node.
That, or use Vlado’s suggestion. 
/*
mixNormalMaps_tx_v001
Created 2016-01-10 by Rens Heeren
mail [at] rensheeren [dot] com
www.rensheeren.com
A shader for mixing together normal maps as outlined on this page
http://blog.selfshadow.com/publications/blending-in-detail/
It uses Reoriented Normal Mapping as described in the article as well as
the idea from the second comment by "jarkko" in that article, which I have
named Displacement Vector Normal Blending just to give it a name...
Versions:
v001 - First version.
Use:
Use as an OSL texture node, not a material node.
Plug in two normal maps, and set the mode to either RNM or DVNB. Mix amount
mixes back to to base input, meaning 1 is the result and 0 is the base as output.
*/
// Reoriented Normal Mapping
vector fn_rnm(vector v_n1, vector v_n2)
{
vector v_t = v_n1 * vector(2, 2, 2) + vector(-1, -1, 0);
vector v_u = v_n2 * vector(-2, -2, 2) + vector(1, 1, -1);
vector v_r = v_t * dot(v_t, v_u) - v_u * v_t[2];
v_r = normalize(v_r);
v_r = (v_r + 1) * 0.5;
return v_r;
}
// Displacement Vector Normal Blending
vector fn_disp(vector v_n1, vector v_n2)
{
v_n1 = v_n1 * 2 - 1;
v_n2 = v_n2 * 2 - vector(1, 1, 2);
vector v_r = v_n1 + v_n2;
v_r = normalize(v_r);
v_r = (v_r + 1) * 0.5;
return v_r;
}
shader
mixNormalMaps_tx_v001
(
string input_base_map_1 = "",
color input_base_color_1 = color(0.5, 0.5, 1),
int use_texture_1 = 1
[[ string widget = "checkBox",
string description = "Use the texture instead of the colour."]],
string input_detail_map_2 = "",
color input_detail_color_2 = color(0.5, 0.5, 1),
int use_texture_2 = 1
[[ string widget = "checkBox",
string description = "Use the texture instead of the colour."]],
int mix_mode = 1
[[ string widget = "mapper",
string description = "The blending method to use.",
string options = "Reoriented_Normal_Mapping:1|Displacement_Vector:2" ]],
float mix_amt = 1
[[string description = "Blend/Mix/Strength amount, 0 is the base input as output and 1 is the result of both maps." ]],
output color out_mixed = color(0),
output color out_inputBase = color(0),
output color out_inputDetail = color(0),
//output float out_alpha_mixed = 0,
output float out_alpha_inputBase = 0,
output float out_alpha_inputDetail = 0,
output float out_alpha_mixAmt = 0
)
{
// Declare Inputs
float f_in1 = 1;
color c_in1 = color(0);
if (use_texture_1)
{
c_in1 = texture(input_base_map_1, u, v, "alpha", f_in1);
}
else
{
c_in1 = input_base_color_1;
}
float f_in2 = 1;
color c_in2 = color(0);
if (use_texture_2)
{
c_in2 = texture(input_detail_map_2, u, v, "alpha", f_in2);
}
else
{
c_in2 = input_detail_color_2;
}
int i_mixMode = mix_mode;
float f_mixAmt = clamp(mix_amt, 0, 1);
color c_out = color(0);
// Shader
if (f_mixAmt > 0)
{
c_in2 = mix(color(0.5, 0.5, 1), c_in2, f_mixAmt);
vector v_in1 = vector(c_in1[0], c_in1[1], c_in1[2]);
vector v_in2 = vector(c_in2[0], c_in2[1], c_in2[2]);
vector v_out = vector(0, 0, 0);
if (i_mixMode == 1)
{
v_out = fn_rnm(v_in1, v_in2);
}
if (i_mixMode == 2)
{
v_out = fn_disp(v_in1, v_in2);
}
c_out = color(v_out[0], v_out[1], v_out[2]);
}
else
{
c_out = c_in1;
}
// Outputs
out_mixed = c_out;
out_inputBase = c_in1;
out_inputDetail = c_in2;
//out_alpha_mixed =
out_alpha_inputBase = f_in1;
out_alpha_inputDetail = f_in2;
out_alpha_mixAmt = f_mixAmt;
}
mixNormalMaps_tx_v001.zip (1.37 KB)