Reflections 反射 Reflection Source 反射源 By default, objects in a scene are rendered using Unity’s ‘Standard Shader’. The Standard Shader is a 'physically based shader' (PBS). This attempts to accurately represent the behavior of light on materials by
--------------更新 更简单的方法: //depth: raw depth, nonlinear, 0 at near plane, 1 at far plan float4 screenUVwithDepth=float4(screenUV,depth,1);//now x,y,z are in [0,1] ndcPos=screenUVwithDepth*2-1;//now x,y,z are in [-1,1] and w=1
在这一篇中会实现会介绍折射和反射,以及菲尼尔反射:并且实现镜子和玻璃效果: 这里和之前不同的地方在于取样的是一张CubeMap: demo里的cubemap使用的一样,相机所在位置拍出来的周围环境图: 生成CubeMap的工具脚本: public class RenderCubemapWizard : ScriptableWizard { public Transform renderFromPosition; public Cubemap cubemap; void OnWizardUpdat