RampTexture

  RampTexture(渐变纹理),可以是1D/2D纹理.

  This allows you to accentuate the surface's colors to fake the effects of more bounce light or a more advanced lighting setup. You see this technique used a lot more for cartoony games, where you need a more artist-driven look to your Shaders and not so much of a physically-accurate lighting model.

  首先需要一张渐变纹理:

  

  在Half Lambert的基础上,使用RampTexture来控制diffuse shading:

  

  The following is the result you will see after running the code:

  

How it works

  We take the re-mapped diffuse values from the Half Lambert operation and pass them into float2() to create the lookup values for the texture. When a value of 0 is set as the hLambert variable, the tex2D function looks up the pixel value at the UV value of (0,0). In this case it's the subtle peach color from the ramps gradient. When a value of 1 is set for the hLambert variable, the tex2D function looks up the pixel at the UV value of (1,1), or the white color.

  

使用RampTexture来控制diffuse shading的更多相关文章

  1. 【Unity Shaders】Diffuse Shading——漫反射光照改善技巧

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  2. 【Unity Shaders】概述及Diffuse Shading介绍

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  3. Diffuse Shading——漫反射光照改善技巧

    转:http://www.narkii.com/club/thread-355113-1.html 我们会列出两种方法:使用Half Lambert lighting model(半兰伯特光照模型)和 ...

  4. 【Unity Shaders】Diffuse Shading——使用2D ramp texture来创建一个假的BRDF(双向反射分布函数)

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  5. 【Unity Shaders】Diffuse Shading——在Surface Shader中使用properties

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  6. 【Unity Shaders】Diffuse Shading——创建一个自定义的diffuse lighting model(漫反射光照模型)

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  7. 【Unity Shaders】Diffuse Shading——向Surface Shader添加properties

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  8. 【Unity Shaders】Diffuse Shading——创建一个基本的Surface Shader

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  9. UnityShader 表面着色器简单例程集合

    0.前言 这些简单的shader程序都是写于2015年的暑假.当时实验室空调坏了,30多个人在实验室中挥汗如雨,闷热中学习shader的日子还历历在目.这些文章闲置在我个人博客中,一年将过,师弟也到了 ...

随机推荐

  1. 在IIS上搭建FTP服务

    FTP服务 FTP是文件传输协议(File Transfer Protocol)的简称,该协议属于应用层协议(端口号通常为21),用于Internet上的双向文件传输(即文件的上传和下载).在网络上有 ...

  2. sublime python运行插件

    Tools->New plugin 粘贴下面代码,在插件目录新建文件夹,保存 import sublime, sublime_plugin import os class ExampleComm ...

  3. ballerina 学习十六 错误&&异常处理

    ballerina 的error 处理和elxiir 以及rust 比较类似使用模式匹配,但是他的 error lifting 还是比较方便的 同时check 也挺好,异常处理没什么特殊的 throw ...

  4. element popover 不显示/不隐藏问题解决方法

    html代码部分 <el-table-column label="操作"> <template slot-scope="scope"> ...

  5. Maven中配置生成单元测试报告配置

    对junit单元测试的报告: 1.  ------------------------------------------------------- 2.   T E S T S 3.  ------ ...

  6. 当Ucenter和应用通信失败,DZ数据库备份恢复

    http://blog.sina.com.cn/s/blog_775f158f010135uz.html ucenter整合自己的项目 http://jingyan.baidu.com/article ...

  7. Mac下docker搭建lnmp环境 + redis + elasticsearch

    之前在windows下一直使用vagrant做开发, 团队里面也是各种开发环境,几个人也没有统一环境,各种上线都是人肉,偶尔还会有因为开发.测试.生产环境由于软件版本或者配置不一致产生的问题, 今年准 ...

  8. Unit05: JavaScript对象概述 、 常用内置对象一 、 常用内置对象二 、 常用内置对象三

    Unit05: JavaScript对象概述 . 常用内置对象一 . 常用内置对象二 . 常用内置对象三 常用内置对象使用演示: <!DOCTYPE html> <html> ...

  9. java6枚举类型

    java.lang.Enum > 使用enum定义. 类如: public class EnumDemo { enum Edge { TOP, BOTTOM, LEFT, RIGHT//定义了一 ...

  10. 【学习笔记】dp基础

    知识储备:dp入门. 好了,完成了dp入门,我们可以做一些稍微不是那么裸的题了. dp基础,主要是做题,只有练习才能彻底掌握. 洛谷P1417 烹调方案 分析:由于时间的先后会对结果有影响,所以c[i ...