【Ray Tracing from Ground Up】光源(Lights)
来源:互联网 发布:淘宝买家号权重是什么 编辑:程序博客网 时间:2024/05/20 18:54
1. 环境光照
"Images rendered with only ambient illumiation show all surfaces with constant colors" 入射光线,环境光(Ambient Light)给那些有漫反射(diffuse-reflction)材质提供亮度(part of the reflected radiance). 环境光照射的所有面可以有不同的 反射颜色(c)和反射率(l)。反射光线方程如下
2.平行光
没有光源位置,同一方向的平行光线。p受光点的亮度可以表示如下:wi 是p点的立体角
3. 点光源
点光源是虚拟的没有表面积,所有的实际光源都是有表面积的。但是因为简洁的辉度表示,在实际中还是常使用。
implementation
1. 环境光
EnvironmentLight::EnvironmentLight(void): Light(),sampler_ptr(NULL),material_ptr(NULL),u(), v(), w(),wi(){}// --------------------------------------------------------------- get_directionVector3DEnvironmentLight::get_direction(ShadeRec& sr) {w = sr.normal;v = Vector3D(0.0034, 1, 0.0071) ^ w;v.normalize();u = v ^ w;Point3D sp = sampler_ptr->sample_hemisphere();wi = sp.x * u + sp.y * v + sp.z * w;return (wi);}// --------------------------------------------------------------- LRGBColorEnvironmentLight::L(ShadeRec& sr) {return (material_ptr->get_Le(sr));}// ---------------------------------------------------------------- pdf// The following function is not in the book.// It uses Equation 18.6floatEnvironmentLight::pdf(const ShadeRec& sr) const {return (sr.normal * wi * invPI);}
2. 平行光
// ---------------------------------------------------------------------- get_direction// as this function is virtual, it shouldn't be inlined Vector3DDirectional::get_direction(ShadeRec& sr) {return (dir);}// ------------------------------------------------------------------------------ LRGBColorDirectional::L(ShadeRec& s) {return (ls * color);}
3.点光源
// ---------------------------------------------------------------------- get_directionVector3DPointLight::get_direction(ShadeRec& sr) {return ((location - sr.hit_point).hat());}// ---------------------------------------------------------------------- LRGBColorPointLight::L(ShadeRec& sr) {return (ls * color);}
0 0
- 【Ray Tracing from Ground Up】光源(Lights)
- 【Ray Tracing from Ground Up】DRBF
- 【Ray Tracing from Ground Up】阴影 (Shadow)
- 【Ray Tracing from Ground Up】Specular Reflection
- 总结《Ray Tracing from the Ground Up》
- 【Ray Tracing from Ground Up】Ray-Object Interserctions
- 《Ray Tracing from the Ground Up》中的坐标系是怎么确定的
- 问题六十八: 着色模型(shading model)(0)——《Ray Tracing from the Ground Up》代码的移植
- Ray Tracing From The Ground Up--Kevin Suffern--光线跟踪算法技术 [美]萨芬著 刘天慧译(清华大学出版社) 2011 英文原版+中文译版pdf
- Book - Programming from the Ground Up
- Programming from the ground up(0)
- Ray Tracing
- Ray Tracing
- OpenGL ES From the Ground Up, Part 1: Basic Concepts
- 深入REDIS,读REDIS-FROM-THE-GROUND-UP有感
- 读书笔记:Realistic Ray Tracing
- codeforce C. Ray Tracing
- C. Ray Tracing
- CodeForces 474B(Worms)
- hive安装同时以mysql为元数据库
- KDE 4 仿 Plasma 5 主题
- 网络访问框架XUtils
- Linux驱动基础总结
- 【Ray Tracing from Ground Up】光源(Lights)
- mybatis Example Criteria like 模糊查询
- JavaScript和Java的区别
- swift2 函数
- .NET方法中参数过多的解决方法
- No mapping found for HTTP request with URI [/MessBoard/login/images/bg_1.jpg] in DispatcherServlet w
- 比如对 姓名字段,可以同时查询两个姓名的记录
- java并发编程——共享资源的操作
- 初识animate()