Logo
Explore Help
Register Sign In
Cr8-xyz/blender
1
0
Fork 0
You've already forked blender
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
f94123a5c651b8a65e5e6e11cd2aed8fcc766498
blender/intern/cycles/kernel/osl/nodes/node_fresnel.h

22 lines
471 B
C
Raw Normal View History

Cycles render engine, initial commit. This is the engine itself, blender modifications and build instructions will follow later. Cycles uses code from some great open source projects, many thanks them: * BVH building and traversal code from NVidia's "Understanding the Efficiency of Ray Traversal on GPUs": http://code.google.com/p/understanding-the-efficiency-of-ray-traversal-on-gpus/ * Open Shading Language for a large part of the shading system: http://code.google.com/p/openshadinglanguage/ * Blender for procedural textures and a few other nodes. * Approximate Catmull Clark subdivision from NVidia Mesh tools: http://code.google.com/p/nvidia-mesh-tools/ * Sobol direction vectors from: http://web.maths.unsw.edu.au/~fkuo/sobol/ * Film response functions from: http://www.cs.columbia.edu/CAVE/software/softlib/dorf.php
2011-04-27 11:58:34 +00:00
float fresnel_dielectric(vector Incoming, normal Normal, float eta)
{
/* compute fresnel reflectance without explicitly computing
the refracted direction */
float c = fabs(dot(Incoming, Normal));
float g = eta * eta - 1 + c * c;
float result;
if(g > 0) {
g = sqrt(g);
float A =(g - c)/(g + c);
float B =(c *(g + c)- 1)/(c *(g - c)+ 1);
result = 0.5 * A * A *(1 + B * B);
}
else
result = 1.0; /* TIR (no refracted component) */
return result;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 789ms Template: 16ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API