float ConvertDepth( float depthFromTex, float4 cameraParams )
{
const float near = cameraParams.z;
const float far = cameraParams.w;
const float nearMulFar = cameraParams.x;
const float nearSubFar = cameraParams.y;
return nearMulFar / ( depthFromTex * nearSubFar + far );
}

depth linear的更多相关文章

  1. depth and distance

    1down votefavorite   I'm implementing ominidirectional shadow mapping for point lights. I want to us ...

  2. Linear or non-linear shadow maps?

    Quote: Original post by RobMaddisonI understand that, for aliasing mitigation, it might be beneficia ...

  3. 【LeetCode】【Python题解】Single Number & Maximum Depth of Binary Tree

    今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的.由于c++版的代码网上比較多.所以就仅仅分享一下Python的代码吧,刚学完Python的基本的语法,做做Lee ...

  4. 测试不同格式下depth buffer的精度

    这篇文章主要是参考MJP的“Attack of The Depth Buffer”,测试不同格式下depth buffer的精度. 测试的depth buffer包含两类: 一是非线性的depth b ...

  5. 机器学习笔记-1 Linear Regression with Multiple Variables(week 2)

    1. Multiple Features note:X0 is equal to 1 2. Feature Scaling Idea: make sure features are on a simi ...

  6. 引擎设计跟踪(九.14.3.1) deferred shading: Depthstencil as GBuffer depth

    问题汇总 1.Light support for Editor编辑器加入了灯光工具, 可以添加和修改灯光. 问题1. light object的用户互交.point light可以把对应的volume ...

  7. Screen Space Depth Varying Glow based on Heat Diffusion

    Inspired by "Interactive Depth of Field Using Simulated Diffusion on a GPU" with heat diff ...

  8. opencv 图像深度(depth)

    原文地址:http://blog.csdn.net/dingfc/article/details/7457984 图像深度是指存储每个像素所用的位数,也用于量度图像的色彩分辨率.图像深度确定彩色图像的 ...

  9. Bayesian generalized linear model (GLM) | 贝叶斯广义线性回归实例

    一些问题: 1. 什么时候我的问题可以用GLM,什么时候我的问题不能用GLM? 2. GLM到底能给我们带来什么好处? 3. 如何评价GLM模型的好坏? 广义线性回归啊,虐了我快几个月了,还是没有彻底 ...

随机推荐

  1. webpack的css,less,sass中使用绝对路径

    用法: 使用~表示绝对路径,如下: @import "~otherfile.scss" .yourClass { background: url('~img/wallpaper.p ...

  2. AE中实现Control中的各种图形工具的方法

    添加命名空间 using ESRI.ArcGIS.SystemUI;using ESRI.ArcGIS.Controls; A类:前面有Controls 后面有tool的工具都可以用同一类的代码实现( ...

  3. hihocoder 后缀自动机二·重复旋律5

    求不同子串个数 裸的后缀自动机 #include<cstring> #include<cmath> #include<iostream> #include<a ...

  4. PHP AES128加密解密

    <?php /** * Class AES */ class AES { public static function encrypt($input, $key) { $size = mcryp ...

  5. C语言.c和.h

    简单的说其实要理解C文件与头文件(即.h)有什么不同之处,首先需要弄明白编译器的工作过程,一般说来编译器会做以下几个过程:       1.预处理阶段 2.词法与语法分析阶段 3.编译阶段,首先编译成 ...

  6. linux之expr命令

    expr命令可以实现数值运算.数值或字符串比较.字符串匹配.字符串提取.字符串长度计算等功能.它还具有几个特殊功能,判断变量或参数是否为整数.是否为空.是否为0等. 先看expr命令的info文档in ...

  7. [LeetCode] Sort List 排序 sort

    Sort a linked list in O(n log n) time using constant space complexity. Hide Tags Linked List Sort   ...

  8. 有关cookie的内容

    包括: Cookie概述(Cookie的存放,有效期和作用域) Cookie操作(保存Cookie,读取Cookie,Cookie的生命周期) Cookie工作原理(Cookie与会话跟踪,Cooki ...

  9. 3.sql

    from odps import ODPS o = ODPS(access_id="LTASVb3aOF3ghjek", secret_access_key="FeUoz ...

  10. PE文件从文件加载到内存,再从内存读取,然后存盘到文件

    // mem.cpp : 定义控制台应用程序的入口点. //PE文件从文件加载到内存,再从内存读取,然后存盘到文件 #include "stdafx.h" #include < ...