Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-06-26 06:27:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-26 06:27:54 +0300
commitf0863f2a803d63c4bc9e3012a7fb6ceb4c194219 (patch)
tree58a53050e1827f06f4c6460ad209b3e7f868af44 /source/blender/gpu/shaders
parent3cbf77b34f7f15c134c8df4d129fe08c0d34d111 (diff)
parentce531ed1a12edcc51b717cbc12e38e8550e8f979 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 28a94f8d78d..88974148505 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2648,7 +2648,7 @@ void node_bsdf_toon(vec4 color, float size, float tsmooth, vec3 N, out vec4 resu
void node_bsdf_principled(vec4 base_color, float subsurface, vec3 subsurface_radius, vec4 subsurface_color, float metallic, float specular,
float specular_tint, float roughness, float anisotropic, float anisotropic_rotation, float sheen, float sheen_tint, float clearcoat,
- float clearcoat_gloss, float ior, float transmission, float transmission_roughness, vec3 N, vec3 CN, vec3 T, vec3 I, out vec4 result)
+ float clearcoat_roughness, float ior, float transmission, float transmission_roughness, vec3 N, vec3 CN, vec3 T, vec3 I, out vec4 result)
{
/* ambient light */
// TODO: set ambient light to an appropriate value
@@ -2657,7 +2657,7 @@ void node_bsdf_principled(vec4 base_color, float subsurface, vec3 subsurface_rad
float eta = (2.0 / (1.0 - sqrt(0.08 * specular))) - 1.0;
/* set the viewing vector */
- vec3 V = -normalize(I);
+ vec3 V = (gl_ProjectionMatrix[3][3] == 0.0) ? -normalize(I) : vec3(0.0, 0.0, 1.0);
/* get the tangent */
vec3 Tangent = T;
@@ -2752,7 +2752,7 @@ void node_bsdf_principled(vec4 base_color, float subsurface, vec3 subsurface_rad
//float FH = schlick_fresnel(LdotH);
// clearcoat (ior = 1.5 -> F0 = 0.04)
- float Dr = GTR1(CNdotH, mix(0.1, 0.001, clearcoat_gloss));
+ float Dr = GTR1(CNdotH, sqr(clearcoat_roughness));
float Fr = fresnel_dielectric_cos(LdotH, 1.5); //mix(0.04, 1.0, FH);
float Gr = smithG_GGX(CNdotL, 0.25) * smithG_GGX(CNdotV, 0.25);