unity中camera怎么生成使用深度图 Camera Depth Texture 实现Image Effect
来源:互联网 发布:手机免费sip软件 编辑:程序博客网 时间:2024/05/22 10:57
看了看景深的源码,然后在文档中找到
DepthTextureMode.Depth
Description
Generate a depth texture.
Will generate a screen-space depth texture as seen from this camera.Texture will be in RenderTextureFormat.Depth format and will be set as_CameraDepthTexture
global shader property.
See Also: Camera.depthTextureMode.
景深源码DepthOfField34.shader 中有定义和使用:
。。。。
sampler2D _CameraDepthTexture;
。。。。。
float d = UNITY_SAMPLE_DEPTH ( tex2D (_CameraDepthTexture, i.uv1.xy) );
。。。。
这个CameraDepthTexture是unity内部隐藏的,当源码DepthOfField34.js中
function OnEnable() {
camera.depthTextureMode |= DepthTextureMode.Depth;
}
那么camera就会生成深度图了。直接用这个内部的就行。
0 0
- unity中camera怎么生成使用深度图 Camera Depth Texture 实现Image Effect
- Camera’s Depth Texture
- unity-使用 Camera 和 Render Texture 制作小地图
- [Unity3D]深度相机 Depth Camera
- [Unity3D]深度相机 Depth Camera
- Unity3D深度相机 Depth Camera
- Unity中Camera的Clear flags,Culling Mask,Depth参数
- Vuforia Unity Camera Image Access
- Vuforia Unity Camera Image Access
- Unity3D翻译——Camera's Depth Texture
- unity中Camera.ScreenToWorldPoint
- Unity 对Camera 属性Clear Flags 的SkyBox/Solid Color/Depth Only深度解析
- Depth image 深度图
- Zoom In and Out camera[ binocular effect ] in Unity
- Unity中camera的使用方法
- Unity - Camera
- 使用Camera实现三维动画
- 使用Camera实现拍照
- 真正的免费wifi是哪种,从哪里看门道?
- CPU对内存管理二
- 交换函数Exchanger的使用
- HDU 2089_不要62
- 程序开始
- unity中camera怎么生成使用深度图 Camera Depth Texture 实现Image Effect
- 下机——观察者模式
- Chromium的沙盒Sandbox
- C++中强制类型转换 static_cast、dynamic_cast 区别(转载)
- mysql 获取本周 本月所属数据
- uva 10588 - Queuing at the doctors(优先队列)
- 根据两点经纬度计算距离 附C#和PHP代码
- ViewGroup全面分析
- cocos2d-x 3.0游戏实例学习笔记《卡牌塔防》第四步---编辑器(3)--坐标保存&加载文件操作