vs

float4 ep = TBMultiply(ModelViewMatrix, FinalPosition);
DistFromEye.x = TBSaturate( 10.0 + ep.z / 10.0 );
DistFromEye.y = -ep.z;
ScaledElapsedTime.x = ElapsedTime * 0.1;
ScaledElapsedTime.y = ElapsedTime * 0.1;
float3x3 myTangentBasis = float3x3(FinalTangent, FinalBinormal, FinalNormal);
Incident = TBMultiply(TBCast(float3x3, ModelViewMatrixInverse), ep.xyz);// scaled position proj back to model space
Incident = TBMultiplyInvs(myTangentBasis, Incident);// to tangent space

ps

float3 incidentVec = -normalize(Incident);
float3 cube = TextureLookupCube(CubeMap, CubeMap_ULL, reflect(incidentVec, bumpedNormal)).xyz * ReflectionStrength;
half R0 = 0.0203;
half edotn = abs(dot(-incidentVec, bumpedNormal));
half fresnel = R0 + (1.0-R0) * pow(1.0-edotn, 5.0);//compute in tangent space

FPOutput.rgb = TBLerp(col, cube, fresnel);

////////////////

complex solution:

half currentDepth = DepthTextureLookup( RenderDepthBufferAsColour, RenderDepthBufferAsColour_ULL, screenTexCoord ).x;
currentDepth = FarPlane * NearPlane / ( currentDepth * ( NearPlane - FarPlane ) + FarPlane );
/* float2 DistFromEye; DistFromEye.x = saturate( 10.0 + ep.z / 10.0 );
DistFromEye.y = -ep.z;*/ float invClarityLength = 1.0 / ClarityLength;
float depth = TBSaturate((currentDepth - DistFromEye.y) * invClarityLength);
float kClarity = 1.0 - depth; DistFromEye.x = TBSaturate(DistFromEye.x);
float2 offsetCoord = renderBufferCopyCoords + bumpedNormal.xy * DistFromEye.x * 0.1f * depth;

泳池水面fresnel 的近似替代的更多相关文章

  1. 由浅入深学习PBR的原理和实现

    目录 一. 前言 1.1 本文动机 1.2 PBR知识体系 1.3 本文内容及特点 二. 初阶:PBR基本认知和应用 2.1 PBR的基本介绍 2.1.1 PBR概念 2.1.2 与物理渲染的差别 2 ...

  2. IRLS(迭代加权最小二乘)

    IRLS用于解决这种目标函数的优化问题(实际上是用2范数来近似替代p范数,特殊的如1范数). 可将其等价变形为加权的线性最小二乘问题: 其中W(t)可看成对角矩阵,每步的w可用下面的序列代替 如果 p ...

  3. 深入剖析iLBC的丢包补偿技术(PLC)

    转自:http://blog.csdn.net/wanggp_2007/article/details/5136609 丢包补偿技术(Packet Loss Concealment——PLC)是iLB ...

  4. 理解SIFT

    理解SIFT.tab{font-size:12px; margin-bottom: 10px;}.tab a{cursor:pointer;cursor:pointer;display:inline- ...

  5. 介绍一个全局最优化的方法:随机游走算法(Random Walk)

    1. 关于全局最优化求解   全局最优化是一个非常复杂的问题,目前还没有一个通用的办法可以对任意复杂函数求解全局最优值.上一篇文章讲解了一个求解局部极小值的方法--梯度下降法.这种方法对于求解精度不高 ...

  6. Ceph: A Scalable, High-Performance Distributed File System译文

    原文地址:陈晓csdn博客 http://blog.csdn.net/juvxiao/article/details/39495037 论文概况 论文名称:Ceph: A Scalable, High ...

  7. Boosting(提升方法)之GBDT

    一.GBDT的通俗理解 提升方法采用的是加法模型和前向分步算法来解决分类和回归问题,而以决策树作为基函数的提升方法称为提升树(boosting tree).GBDT(Gradient Boosting ...

  8. 游戏AI之路径规划(3)

    目录 使用路径点(Way Point)作为节点 洪水填充算法创建路径点 使用导航网(Navigation Mesh)作为节点 区域分割 预计算 路径查询表 路径成本查询表 寻路的改进 平均帧运算 路径 ...

  9. Windows7 64位环境6sv2.1大气传输模型修改源码添加国产高分卫星GF-1 GF-2光谱响应支持

    下面开始添加国产卫星光谱响应的支持: 以下主要参考文章“6S大气传输模型修改源码添加.自定义卫星光谱响应(以HJ-1B CCD为例)”网址:http://blog.csdn.net/sam92/art ...

随机推荐

  1. 如何修改root密码

    默认情况下,每次登录ubuntu都会生成一个随机的root密码,如果想要修改, sudo passwd 然后输入密码,这个密码就作为root用户的密码

  2. 【bzoj4894】天赋 矩阵树定理

    题目描述 小明有许多潜在的天赋,他希望学习这些天赋来变得更强.正如许多游戏中一样,小明也有n种潜在的天赋,但有一些天赋必须是要有前置天赋才能够学习得到的.也就是说,有一些天赋必须是要在学习了另一个天赋 ...

  3. [codeforces] 578C Weakness and Poorness || 三分

    原题 题目定义了两个变量: poorness表示一个区间内和的绝对值. weakness表示一个所有区间最大的poornesss 题目要求你求一个x使得 a1 − x, a2 − x, ..., an ...

  4. 输出读入优化——QAQ

    #include<bits/stdc++.h> const int RN=1e5; ],*ip=ib+RN,ob[RN+],*op=ob; inline int gc(){ ip==ib+ ...

  5. 日志组件Log4Net

    <?xml version="1.0" encoding="utf-8"?> <configuration> <configSec ...

  6. Spring中报"Could not resolve placeholder"的解决方案(引入多个properties文件)

    除去properites文件路径错误.拼写错误外,出现"Could not resolve placeholder"很有可能是使用了多个PropertyPlaceholderCon ...

  7. python grequests和requests比较

    #!/usr/bin/env python # encoding: utf-8 import grequests import requests import timeit import time d ...

  8. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.Exec

    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.tr ...

  9. 阿里云服务器上使用apt-get install出现404 Not Found

    阿里云服务器上使用apt-get install出现404 Not Found 刚申请了的阿里云服务器,在其Ubuntu上用apt-get install安装软件时,会遇到 Failed to fet ...

  10. ws2s函数

    std::string ws2s(const std::wstring& str) { char* pElementText; int iTextLen; // wide char to mu ...