Shader Learing(Transparent Shader篇)

Shader Learing(Transparent Shader篇)

透明物体的写法:
一种是clip,写zwrite,好处是不会排序混乱,坏处是没法blend,即透明度测试,透明度测试不能实现半透,只会删除一些片元,看上去像镂空一些面。(解释:设定一个透明度的值,如a,当物体的透明度>a时,按透明处理,直接舍弃,当透明度<a时,按正常物体处理,及深度测试,深度写入,然后深度值要小的物体就被舍弃掉了,不会渲染,也就是透明物体之后的物体不会被渲染了)。
另一种就是blend,不写zwrite,这时候就完全依赖于排序,即透明度混合。(解释:必须先渲染不透明物体,再渲染透明物体,再进行深度测试,被不透明物体挡住的就不会被渲染,挡住不透明物体的,就能正确进行颜色的混合)。
如果你有一个物体里面的面片互相穿插,可以使用两个pass,一个写深度,另外一个做alpha blending。


渲染顺序Queue:

Background 1000 通常用这个队列渲染需要绘制在背景上的物体
Geometry  2000 默认值;大部分物体在这个队列。不透明的物体也在这里
AlphaTest 2450 需要透明度测试物体使用的队列
Transparent 3000 在Geometry和AlphaTest渲染后,再从后往前渲染。透明度混合物体都该用
Overlay 4000 实现叠加效果[如镜头光晕]。任何需要最后渲染的,用这个。
自定义 用户可以定义任意值,比如"Queue"="Geometry+10"

RenderType[将Shader分类,用于Shader替换]:

Opaque       绝大部分不透明的物体都使用这个
Transparent   绝大部分透明的物体、包括粒子特效都使用这个
TransparentCutout蒙皮透明着色器
Background   天空盒都使用这个
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Shadero Sprite is a real time node-based shader tool for Unity 5, 2017 and 2018 NEW! Forum : https://forum.vetasoft.store/ Discuss with us about Shadero Sprite and more ! Description Shadero Sprite is a real time node-based shader editor. Shadero was made to be a real production time saver. Beautiful and fast, it creates many astonishing effects with the several premade and fully optimized node effects. Shadero will increase the number of the premade effects in every update. No code required. Features - Ultimate tools for 2D Shader Editor - Node based editor - Real time preview - Source code included - Load/Save project - Optimised shader - Fog Support - HDR Support - Visual selection node preview - Light Support - Blend Mode support - Normalmap with light Support - Preview directly the scene - Works with Unity UI - Many premade effects (+100) - Help Tutorial in editor - Project examples - Unity 5 and 2017 and 2018 compatible - Support Anima 2D - Support Render Texture - Support Mesh Renderer - Generate a Sprite - Create Morphing - And much much more ! http://www.shadero.com New version 1.7.0 see version history Version 1.1 - Add Node: UV > FX (UV) > Sprite Sheet Animation - Add Node: UV > FX (UV) > Pixel - Add Node: UV > FX (UV) > Fish Eye - Add Node: UV > FX (UV) > Pinch - Add Node: UV > FX (UV) > Kaleiodoscope - Add Node: Generate > Shape > XRay - Add Node: Generate > Shape > Donuts - Add Node: Generate > Shape > Lines - Add Node: Generate > Shape > Noise - Add Node: RGBA > Color > Turn Metal - Add Node: RGBA > Color > Turn Gold - Add Node: RGBA > Color > Turn Transparent - Add Node: RGBA > Color > HDR Control Value - Add Node: RGBA > Color > HDR Create - Add Force Change Parameters to the Build Shader Node (Experimental) - Add Lightning Support - Fix Node: UV > FX (UV) > Pixel XY precision - Fix new Shader Project that keep the preview material issue - Fix Auto variable order issue when you add the same node Any Feedback, error reports, questions or suggestions, please contact us at [email protected] If you like Shadero Sprite you can rate it on the asset store, it would be very helpful. Any idea or suggestions to improve Shadero Sprite? Feel free to contact us at : [email protected]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值