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

node_fresnel.osl « shaders « osl « kernel « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e80d956851d27a3846823486e2e8ddcdf3c85f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "node_fresnel.h"
#include "stdcycles.h"

shader node_fresnel(float IOR = 1.45, normal Normal = N, output float Fac = 0.0)
{
  float f = max(IOR, 1e-5);
  float eta = backfacing() ? 1.0 / f : f;
  float cosi = dot(I, Normal);
  Fac = fresnel_dielectric_cos(cosi, eta);
}