Rendering with Replaced Shaders
2014-07-27 15:46
447 查看
【Rendering with Replaced Shaders】
It works like this: the camera renders the scene as it normally would. the objects still use their materials, but the actual shader that ends up being used is changed:
如果replacementTag非空,则:
1)如果对象的shader没有replacementTag,则对象不被渲染。
2)在replacement shader中寻找相应replacement tag的subshader,如果没有,则不渲染。
3)用2)中的subshader渲染1)中replacement tag value相同的对象。
So if all shaders would have, for example, a "RenderType" tag with values like "Opaque", "Transparent", "Background", "Overlay", you could write a replacement shader that only renders solid objects by using one subshader with RenderType=Solid tag. The other tag types would not be found in the replacement shader, so the objects would be not rendered. Or you could write several subshaders for different "RenderType" tag values. Incidentally, all built-in Unity shaders have a "RenderType" tag set.
[Shader replacement tags in built-in Unity shaders]
All built-in Unity shaders have a “RenderType” tag set that can be used when rendering with replaced shaders. Tag values are the following:
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/SL-ShaderReplacement.html
It works like this: the camera renders the scene as it normally would. the objects still use their materials, but the actual shader that ends up being used is changed:
如果replacementTag非空,则:
1)如果对象的shader没有replacementTag,则对象不被渲染。
2)在replacement shader中寻找相应replacement tag的subshader,如果没有,则不渲染。
3)用2)中的subshader渲染1)中replacement tag value相同的对象。
So if all shaders would have, for example, a "RenderType" tag with values like "Opaque", "Transparent", "Background", "Overlay", you could write a replacement shader that only renders solid objects by using one subshader with RenderType=Solid tag. The other tag types would not be found in the replacement shader, so the objects would be not rendered. Or you could write several subshaders for different "RenderType" tag values. Incidentally, all built-in Unity shaders have a "RenderType" tag set.
[Shader replacement tags in built-in Unity shaders]
All built-in Unity shaders have a “RenderType” tag set that can be used when rendering with replaced shaders. Tag values are the following:
参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/SL-ShaderReplacement.html
相关文章推荐
- unity, 替换shader渲染(Rendering with Replaced Shaders)
- unity, 替换shader渲染(Rendering with Replaced Shaders)
- unity, 替换shader渲染(Rendering with Replaced Shaders)
- unity 替换渲染 ( Rendering with Replaced Shaders )
- unity 替换渲染 ( Rendering with Replaced Shaders )
- Unity3D翻译——Rendering with Replaced Shaders
- Render Type & Rendering with Replaced Shaders
- XNA--Rendering Pipeline, Shaders, and Effects
- Graphics2D渲染(Rendering with Graphics2D)上
- Syncovery : Google Docs protocol completely replaced with Google Drive
- [RxJS] Basic DOM Rendering with Subscribe
- IOS7新特性(imageWithRenderingMode:)
- Video Rendering with 8-Bit YUV Formats
- Rendering underwater scene with EDXRay
- Graphics2D渲染(Rendering with Graphics2D)下
- 爬虫的问题WARNING:root:Some characters could not be decoded, and were replaced with REPLACEMENT CHARACTER
- [Angular 2] Rendering an Observable with the Async Pipe
- Exploring GLSL – Normal Visualizer with Geometry Shaders
- 对于imageWithRenderingMode方法的两种参数的使用解释
- Statement lambda can be replaced with expression lambda 的Warning