PBR help!

I need help regarding the way that diffuse and specular colors are combined. If the diffuse is Lambertian diffuse color and the specular is cubemap multiplied by specular color, how would these two be combined for the final color? Addition? Weighted average (using what weights)?

Fresnel plugged into fac of mix shader. I personally use layer weight to the power of 5 (to more easily control the F-0 value), and I also share roughness value (so Oren-Nayar rather than Lambertian).

If you’re talking about the PBR diffuse/spec maps, the spec map there is fairly different from a traditional spec map. Instead of the color of the highlight, it represents the refractive index at different wavelengths. The shader relationship is a little complex, it looks something like this:

I’d really recommend you use a metalness worflow to do PBR in Cycles, it’s a lot simpler to set up than trying to rebuild the schlick approximation with math nodes.

I’m building this in GLSL, actually:

varying vec3 Normal;
varying vec3 EyeDir;
varying vec3 Light;

varying vec4 Color;
varying vec4 SpecColor;

uniform samplerCube cubeMap;

void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
Normal = gl_NormalMatrix * gl_Normal;
EyeDir = vec3(gl_ModelViewMatrix * gl_Vertex);
Light = vec3(0,1,0);
Color = gl_Color;
SpecColor = vec4(0.2);
}

varying vec3 Normal;
varying vec3 EyeDir;
varying vec3 Light;

varying vec4 Color;
varying vec4 SpecColor;

uniform samplerCube cubeMap;

void main()
{
vec3 reflectedDirection = normalize(reflect(EyeDir, normalize(Normal)));
vec4 fragColor = textureCube(cubeMap, reflectedDirection);
vec4 halfDif = 0.5 * Color;
vec4 intense = max(0, dot(Light, Normal));
gl_FragColor = dot(fragColor, SpecColor) + (0.8 * ((halfDif * intense) + halfDif));
}

Note the fresnel is missing, and that the intended formula for diffuse is vec3(1.0-max(SpecColor), rather than vec3(1.0)-SpecColor.