渲染路径-surface shader 光照函数与渲染路径
https://docs.unity3d.com/Manual/SL-SurfaceShaderLighting.html
Lighting Model declaration
Lighting model is a couple of regular functions with names starting with Lighting. They can be declared anywhere in your shader file or one of included files. The functions
are:
half4 Lighting<Name> (SurfaceOutput s, UnityGI gi);This is used inforward rendering
path for light models that are not view direction dependent (e.g. diffuse).half4 Lighting<Name> (SurfaceOutput s, half3 viewDir, UnityGI gi);This is used inforward
rendering path for light models that are view direction dependent.half4 Lighting<Name>_Deferred(SurfaceOutput s, UnityGI gi, out half4 outDiffuseOcclusion,This isused in deferred lighting path.
out half4 outSpecSmoothness, out half4 outNormal);half4 Lighting<Name>_PrePass (SurfaceOutput s, half4 light);This
is used in light prepass (legacy deferred) lighting path.
Note that you don’t need to declare all functions. A lighting model either uses view direction or it does not. Similarly, if the lighting model only works in forward, do not declare the _Deferred or _Prepass function.
This way, all Shaders that use it compile to forward rendering only.
渲染路径-surface shader 光照函数与渲染路径的更多相关文章
- Unity Shader——Writing Surface Shaders(3)——Surface Shader Lighting Examples
Surface Shader 光照例子 这里有一些自定义光照模型和Surface Shaders的例子.通常的Surface Shader例子在这里. 由于延迟光照在某些自定义的逐材质光照模型中表现得 ...
- 小强学渲染之Unity Shader编程HelloWorld
第一个简单的顶点vert/片元frag着色器 1)打开Unity 5.6编辑器,新建一个场景后ctrl+s保存命名为Scene_5.默认创建的场景是包含了一摄像机,一平行光,且场景背景是一天空盒而 ...
- Unity3D -- shader光照常用函数和变量
上一篇记录了shader常用函数和变量,这篇记录一些光照计算时常用函数和变量 1.内置的光照变量 _LightColor0 float4 //该Pass处理的逐像素光源的颜色 _WorldSpaceL ...
- Android系统Surface机制的SurfaceFlinger服务渲染应用程序UI的过程分析
参考:Android系统Surface机制的SurfaceFlinger服务渲染应用程序UI的过程分析 一句话概括一下Android应用程序显示的过程:Android应用程序调用SurfaceFlin ...
- Unity5 新功能解析--物理渲染与standard shader
Unity5 新功能解析--物理渲染与standard shader http://blog.csdn.net/leonwei/article/details/48395061 物理渲染是UNITY5 ...
- android Shader类简介_渲染图像示例
Android中提供了Shader类专门用来渲染图像以及一些几何图形,Shader下面包括几个直接子类,分别是BitmapShader. ComposeShader.LinearGradient.Ra ...
- Surface Shader简单向导
Surface Shader 表面着色器 描述 当你的Material要处理光照,则一般使用Surface Shader.Surface Shader隐藏了光照的计算,你只需要在surf函数里设置好反 ...
- Unity Shader——Writing Surface Shaders(1)——Surface Shader Examples
这里有Surface Shader的一些例子.下面的这些例子关注使用内建的光照模型:关于如何使用自定义光照模型的例子参见Surface Shader Lighting Examples. 简单 我们将 ...
- Surface Shader
Surface Shader: (1)必须放在SubShdader块,不能放在Pass内部: (2)#pragma sufrace surfaceFunction lightModel [option ...
随机推荐
- 扫盲-wpf依赖属性
一.什么是依赖属性 依赖属性就是一种自己可以没有值,并且可以通过绑定从其他数据源获取值.依赖属性可支持WPF中的样式设置.数据绑定.继承.动画及默认值. 将所有的属性都设置为依赖属性并不总是正确的解决 ...
- 关于button的自动刷新
今天在开发中遇到了ajax传数据到后台,处理结果正常,返回的resultMap是一个Map<String,Object>类型,但是返回时显示'Fail to load response d ...
- Java for LeetCode 119 Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3 ...
- logback 配置详解(下)
logback 常用配置详解(二) <appender> <appender>: <appender>是<configuration>的子节点,是负责写 ...
- BZOJ 1612 [Usaco2008 Jan]Cow Contest奶牛的比赛:floyd传递闭包
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1612 题意: 有n头牛比赛. 告诉你m组(a,b),表示牛a成绩比牛b高. 保证排名没有并 ...
- smack api 转载未测试
===============================================================主动发送信息给某个用户-------------------------- ...
- 网络编程学习笔记-MAC地址和IP地址的关系
简单地说:ip地址是服务商给你的,mac地址是你的网卡物理地址. 一.IP地址 对于IP地址,相信大家都很熟悉,即指使用TCP/IP协议指定给主机的32位地址.IP地址由用点分隔开的4个8八位组构成, ...
- DBSCAN 聚类分析
DBSCANCLUSTER DBSCAN(Density-basedspatial clustering ofapplications with noise)Martin.Ester, Hans-Pe ...
- Gym - 101673:B Craters (几何,求凸包)
题意:给定几个圆,求最短的围合,把这几个包围起来,而且到圆的距离都不小于10. 思路:把每个圆的半径+10,边等分5000份,然后求凸包即可. #include<bits/stdc++.h> ...
- bootstrap框架日期时间之年月选择及汉化
==>上次介绍了bootstrap框架日期时间 开始日期和结束日期选择 http://www.cnblogs.com/wjqblogs/p/4043198.html 今天又做了个只选择年月的日期 ...