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:
Diffstat (limited to 'intern/cycles/kernel/svm/svm_closure.h')
-rw-r--r--intern/cycles/kernel/svm/svm_closure.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h
index 96d99849d1f..7e6471458ef 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -301,32 +301,32 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
if(specular_weight > CLOSURE_WEIGHT_CUTOFF && (specular > CLOSURE_WEIGHT_CUTOFF || metallic > CLOSURE_WEIGHT_CUTOFF)) {
float3 spec_weight = weight * specular_weight;
- /* for roughness values close to 0 handle as a sharp reflection */
- if(roughness <= 1e-2f) {
- float spec_to_ior = (2.0f / (1.0f - safe_sqrtf(0.08f * specular))) - 1.0f;
+ ///* for roughness values close to 0 handle as a sharp reflection */
+ //if(roughness <= 1e-2f) {
+ // float spec_to_ior = (2.0f / (1.0f - safe_sqrtf(0.08f * specular))) - 1.0f;
- float m_cdlum = linear_rgb_to_gray(base_color);
- float3 m_ctint = m_cdlum > 0.0f ? base_color / m_cdlum : make_float3(0.0f, 0.0f, 0.0f); // normalize lum. to isolate hue+sat
- float3 tmp_col = make_float3(1.0f, 1.0f, 1.0f) * (1.0f - specular_tint) + m_ctint * specular_tint;
- float3 cspec0 = (specular * 0.08f * tmp_col) * (1.0f - metallic) + base_color * metallic;
+ // float m_cdlum = linear_rgb_to_gray(base_color);
+ // float3 m_ctint = m_cdlum > 0.0f ? base_color / m_cdlum : make_float3(0.0f, 0.0f, 0.0f); // normalize lum. to isolate hue+sat
+ // float3 tmp_col = make_float3(1.0f, 1.0f, 1.0f) * (1.0f - specular_tint) + m_ctint * specular_tint;
+ // float3 cspec0 = (specular * 0.08f * tmp_col) * (1.0f - metallic) + base_color * metallic;
- float F0 = fresnel_dielectric_cos(1.0f, spec_to_ior);
- float F0_norm = 1.0f / (1.0f - F0);
- float FH = (fresnel_dielectric_cos(cosNO, spec_to_ior) - F0) * F0_norm;
+ // float F0 = fresnel_dielectric_cos(1.0f, spec_to_ior);
+ // float F0_norm = 1.0f / (1.0f - F0);
+ // float FH = (fresnel_dielectric_cos(cosNO, spec_to_ior) - F0) * F0_norm;
- /* Blend between white and a specular color with respect to the fresnel */
- float3 refl_color = cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH;
+ // /* Blend between white and a specular color with respect to the fresnel */
+ // float3 refl_color = cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH;
- MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), spec_weight*refl_color);
+ // MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), spec_weight*refl_color);
- if(bsdf) {
- bsdf->N = N;
+ // if(bsdf) {
+ // bsdf->N = N;
- /* setup bsdf */
- ccl_fetch(sd, flag) |= bsdf_reflection_setup(bsdf);
- }
- }
- else {
+ // /* setup bsdf */
+ // ccl_fetch(sd, flag) |= bsdf_reflection_setup(bsdf);
+ // }
+ //}
+ //else {
MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), spec_weight);
MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra));
@@ -355,7 +355,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
else /* use multi-scatter GGX */
ccl_fetch(sd, flag) |= bsdf_microfacet_multi_ggx_aniso_fresnel_setup(bsdf);
}
- }
+ //}
}
#ifdef __CAUSTICS_TRICKS__
}
@@ -378,24 +378,24 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
#endif
{
/* for roughness values close to 0 handle as a sharp reflection */
- if(roughness <= 1e-2f) {
- float F0 = fresnel_dielectric_cos(1.0f, ior);
- float F0_norm = 1.0f / (1.0f - F0);
- float FH = (fresnel - F0) * F0_norm;
+ //if(roughness <= 1e-2f) {
+ // float F0 = fresnel_dielectric_cos(1.0f, ior);
+ // float F0_norm = 1.0f / (1.0f - F0);
+ // float FH = (fresnel - F0) * F0_norm;
- /* Blend between white and a specular color with respect to the fresnel */
- float3 refl_color = cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH;
+ // /* Blend between white and a specular color with respect to the fresnel */
+ // float3 refl_color = cspec0 * (1.0f - FH) + make_float3(1.0f, 1.0f, 1.0f) * FH;
- MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), refl_color*glass_weight*fresnel);
+ // MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), refl_color*glass_weight*fresnel);
- if(bsdf) {
- bsdf->N = N;
+ // if(bsdf) {
+ // bsdf->N = N;
- /* setup bsdf */
- ccl_fetch(sd, flag) |= bsdf_reflection_setup(bsdf);
- }
- }
- else {
+ // /* setup bsdf */
+ // ccl_fetch(sd, flag) |= bsdf_reflection_setup(bsdf);
+ // }
+ //}
+ //else {
MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc(sd, sizeof(MicrofacetBsdf), glass_weight*fresnel);
MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra));
@@ -413,7 +413,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
/* setup bsdf */
ccl_fetch(sd, flag) |= bsdf_microfacet_ggx_fresnel_setup(bsdf);
}
- }
+ //}
}
/* refraction */