Merge branch 'master' into blender2.8
authorDalai Felinto <dfelinto@gmail.com>
Mon, 3 Jul 2017 13:07:14 +0000 (15:07 +0200)
committerDalai Felinto <dfelinto@gmail.com>
Mon, 3 Jul 2017 13:18:46 +0000 (15:18 +0200)
1  2 
source/blender/blenkernel/intern/rigidbody.c
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/util/undo.c
source/blender/gpu/shaders/gpu_shader_material.glsl

Simple merge
index 0c36d6ca618aaaf7d13c5037a340a4ad135ef105,67a099159c5035b1755d0729768aeb16dc128bd3..1f9ab45e556e952abf45538d2292275bc1c145d4
@@@ -2684,13 -2623,9 +2684,13 @@@ void node_bsdf_principled(vec4 base_col
        float specular_tint, float roughness, float anisotropic, float anisotropic_rotation, float sheen, float sheen_tint, float clearcoat,
        float clearcoat_roughness, float ior, float transmission, float transmission_roughness, vec3 N, vec3 CN, vec3 T, vec3 I, out vec4 result)
  {
 +      vec3 X, Y;
 +      float ax, ay;
 +      prepare_tangent(anisotropic, anisotropic_rotation, roughness, N, T, X, Y, ax, ay);
 +
        /* ambient light */
        // TODO: set ambient light to an appropriate value
-       vec3 L = vec3(mix(0.1, 0.03, metallic)) * base_color.rgb;
+       vec3 L = mix(0.1, 0.03, metallic) * mix(base_color.rgb, subsurface_color.rgb, subsurface * (1.0 - metallic));
  
        float eta = (2.0 / (1.0 - sqrt(0.08 * specular))) - 1.0;
  
  
        /* directional lights */
        for (int i = 0; i < NUM_LIGHTS; i++) {
 -              vec3 light_position_world = gl_LightSource[i].position.xyz;
 +              vec3 light_position_world = glLightSource[i].position.xyz;
-               vec3 light_position = normalize(NormalMatrix * light_position_world);
+               vec3 light_position = normalize(light_position_world);
  
                vec3 H = normalize(light_position + V);
  
 -              vec3 light_diffuse = gl_LightSource[i].diffuse.rgb;
 -              vec3 light_specular = gl_LightSource[i].specular.rgb;
++              vec3 light_diffuse = glLightSource[i].diffuse.rgb;
 +              vec3 light_specular = glLightSource[i].specular.rgb;
  
                float NdotL = dot(N, light_position);
                float NdotV = dot(N, V);