上个月学习Peter Shirley-Ray Tracing in One Weekend的系列三本书,收获真的很多.这个系列的书真的是手把手教你如何从零开始构建一个光线跟踪渲染器,对新手(像我)非常友好.但是书中有很多章节需要有一定的数学功底才能看懂,本文想分享一下关于in One Weekend-chapter 8:Metal中一笔带过的折射公式推导,内容主要来自于<Mathematics for 3D Game Programming and Computer Graphics, 3rd…
问题:在三维空间中,已知折射率 e .入射角 L 和法线 N. 要求:计算出折射向量 T. 其中: L. N 和 T 都为单位向量. 如图片所示,下面所有的公式都看着这张图片来求解的: 首先,我们必须了解折射定律: 因为 N.T.L都是单位向量,所以: 那么可以从图中看出: 接着,如图中所示,做出辅助向量 t1 .t2.l1.l2,他们满足于: 注意这里的 l2 . t2 都是平行于 N 且反向的.l1 . t1 都是垂直于 N 的. 接着有: 可得 那么: 而 l1 和 t1 是同向的,所以可…
目录 一. 前言 1.1 本文动机 1.2 PBR知识体系 1.3 本文内容及特点 二. 初阶:PBR基本认知和应用 2.1 PBR的基本介绍 2.1.1 PBR概念 2.1.2 与物理渲染的差别 2.1.3 PBR的特征 2.2 PBR的衍变历史 2.2.1 Lambert(1760年) 2.2.2 Smith(1967年) 2.2.3 Phong(1973年) 2.2.4 Cook-Torrance(1982年) 2.2.5 Oren Nayarh(1994年) 2.2.6 Schlick(…
Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a link to a reference page that has more detail about the input argument and return type. Name Syntax D…
此篇博客转自csdn的一位大牛. 中间排版出了一些问题 Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a link to a reference page that has more detail about the input argument an…
Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a link to a reference page that has more detail about the input argument and return type. Name Syntax D…
转自:https://blog.csdn.net/Blues1021/article/details/47093487 基本前提概念 Shader是一种映射到GPU硬件汇编语言上的高级语言,Shader中的数据类型是要声明类型和用途的,用途其实就是和着色器寄存器关联,输入位置寄存器,输出位置寄存器,输出颜色寄存器等.Shader HLSL中的颜色是rgba的类型,不要弄错了.Shader中的每一个类型,函数,字符串都是有含义的. 顶点和像素着色器中,常量表用SetDefault传入Device将…
原文:西川善司 http://www.4gamer.net/games/075/G007535/20160726064/   最终幻想15的演讲会场.相当大,听众非常多.      在本次计算机图形和交互技术大会[SIGGRAPH 2016]上,和游戏相关的CG技术解说方面上,SQUARE ENIX有很强的存在感.这个计划于2016年9月发售的[最终幻想15]的制作相关的会议,很多人都预订参加了.对于外海也有很高关注度的FFXV,有可以了解开发内幕的机会,多数的游戏开发者当然不会错过的.    …
http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/HLSL_Aniso.zip Anisotropic Lighting The anisotropic lighting effect shows the vertex program's halfangle vector calculation. It uses HdotN and LdotN per-vertex to look u…
http://http.download.nvidia.com/developer/SDK/Individual_Samples/samples.html http://http.download.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/VertexTextureFetchWater.zip This sample demonstrates a technique for simulating and renderi…