Colorimetry
摘要:【Colorimetry】 1、Example of Spectral Power Distribution Application An example of the spectral power distribution of light from common objects shows th
阅读全文
HLSL ddx / ddy
摘要:【HLSL ddx / ddy】 在光栅化的时刻,GPUs会在同一时刻并行运行很多Fragment Shader,但是并不是一个pixel一个pixel去执行的,而是将其组织在2x2的一组pixels分块中,去并行执行。 偏导数就正好是计算的这一块像素中的变化率。从下图可以看出来ddx 就是右边的像
阅读全文
HLSL
摘要:【HLSL】 1、Direct3D 9 shaders can be designed using shader model 1, shader model 2 and shader model 3; Direct3D 10 shaders can only be designed on shade
阅读全文
ShadowMap
摘要:【ShadowMap】 一个物体之所以会处在阴影当中,是由于在它和光源之间存在着遮蔽物,或者说遮蔽物离光源的距离比物体要近,这就是 shadow mapping 算法的基本原理。 Pass1: 以光源为视点,或者说在光源坐标系下面对整个场景进行渲染,目的是要得到一副所有物体相对于光源的 depth
阅读全文
径向模糊(Radial Blur)
摘要:【径向模糊(Radial Blur)】 径向模糊,是一种从中心向外呈幅射状的逐渐模糊的效果,在图形处理软件photoshop里面也有这个模糊滤镜。而在游戏中常常用来模拟一些动感的效果,如鬼泣4中的场景切换特效,和一些技能打击特效;赛车游戏也尝用来模拟动感模糊,如狂野飙车,极品飞车等。本例将实现一个类
阅读全文
Signed Distance Field Technique
摘要:【Distance Field Technique】 一种小纹理高清放大的技术。 A distance field is generated from a high resolution image, and then stored into a channel of a lower-resolut
阅读全文
Parallax Mapping
摘要:【Parallax Mapping】 Parallax mapping belongs to the family of displacement mapping techniques that displace or offset vertices based on geometrical inf
阅读全文
Displacement Mapping
摘要:【Displacement Mapping】 Displacement Mapping(移位贴图)。 Normal maps的另一个应用是displacement mapping,在这个应用中,细节的增加不再是通过虚拟光照得到的,而是真正的改变模型的vertices。使用displacement m
阅读全文
Compute Shader
摘要:【Compute Shader】 1、Similar to regular shaders, compute shaders are Asset files in your project, with a .compute file extension. 1)通过 #pragma kernel 指定
阅读全文
渲染Keynote
摘要:【渲染Keynote】 1、渲染图元(rendering primitives),可以是点、线、三角。 2、显卡对于显存的访问速度更快,而且大多数显卡对于RAM没有直接的访问权利 。 3、裁剪(Clipping)是将那些不在摄像机内的顶点裁剪掉。 4、OpenGL左下角为(0,0),右上角为(1,1
阅读全文
Motion Blur
摘要:【Motion Blur】 此篇介绍最简单的全局Motion Blur。算法是将当前帧与前一帧按某一比例混合。这是一个过程,例如有10帧,在第1帧中,只有第1帧原图,第2帧中有1、2帧原图,第3帧中会有1、2、3帧原图,依次类推。 假设混合比较为a,即原图为1-a,累积图为a,那么1帧新进入...
阅读全文
Glow Shader
摘要:【Glow Shader】 Glow Shader基于BlurShader来实现。总的来说分为2步: 1、利用BlurShader渲染出BlurTexture。 2、将BlurTexture与SrcTexture累加在一起。此步利用GlowShader。 本质就是第二步,将SrcTe...
阅读全文
Shder中实现TintColor
摘要:【Shder中实现TintColor】 TintColor实现上相当于一个滤镜,若TintColor的R为0,则原图的R通道颜色应该为0。基于此,实现TintColor很容易,原图颜色直接乘以TintColor即可。 下图的_Color.rgb即为TintColor。 而TintColor...
阅读全文
ShaderForge打造自定义光照模型
摘要:【ShaderForge打造自定义光照模型】1、Lambert逻辑图。 2、Blinn-Phong逻辑图。 参考:https://www.youtube.com/watch?v=EjCXwV0YYdU
阅读全文
Vertex color blending & UV tiling
摘要:【Vertex color blending & UV tiling】1、GemotryData控件用于代码顶点数据,如网格中的Vertex Color(下左图),UV Coord(下右图)。 2、右击每一个控制,会弹出帮助选项,以及输入Comment的选项。 3、Shader Forge中...
阅读全文
Create a Basic Shader in Shader Forge
摘要:【Create a Basic Shader in Shader Forge】1、打开ShaderForge。Window-> Shader Forge。(打开速度较慢)2、通过NewShader按钮创建一个新Shader。 3、左上角Compile Shader会显示当前Shader的状态。 ...
阅读全文
Radial Blur
摘要:【Radial Blur】 核心代码如下: 1 v2f vert (appdata_img v) 2 { 3 v2f o; 4 o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 5 o.uv = v.texcoord.xy; 6...
阅读全文
IrisBlur - 虹膜模糊
摘要:【IrisBlur - 虹膜模糊】 IrisBlur模拟人眼的虹膜,本质上是一个控制程度更高的FieldBlur,在FieldBlur的基础上暴露了更多的参数。 ChooseFilter>Blur Gallery>Iris Blur. The default Iris blur pin is ...
阅读全文
牛X的FieldBlur
摘要:【牛X的FieldBlur】 Use Field Blur to build a gradient of blurs, by defining multiple blur points with different amounts of blur. Add multiple pins to the...
阅读全文
高斯模糊
摘要:【高斯模糊】 高斯模糊(英语:Gaussian Blur),也叫高斯平滑。 高斯模糊(Gaussian Blur)是美国Adobe图像软件公司开发的一个图像处理软件:Adobe Photoshop(系列)中的一个滤镜,具体的位置在:滤镜—模糊——高斯模糊! 高斯模糊的原理中,它是根据高斯曲...
阅读全文