特效Shader对雾的处理

RFX4_Particle.shader案例

#ifdef BlendAdd
    UNITY_APPLY_FOG_COLOR(i.fogCoord, res, half4(0,0,0,0)); 
#endif
#ifdef BlendAlpha
    UNITY_APPLY_FOG(i.fogCoord, res);
#endif
#ifdef BlendMul
    res = lerp(half4(1,1,1,1), res, res.a);
    UNITY_APPLY_FOG_COLOR(i.fogCoord, res, half4(1,1,1,1)); // fog towards white due to our blend mode
#endif
#ifdef BlendMul2
        res = lerp(half4(0.5,0.5,0.5,0.5), res, res.a);
        UNITY_APPLY_FOG_COLOR(i.fogCoord, res, half4(0.5,0.5,0.5,0.5)); // fog towards gray due to our blend mode
#endif

重点是不同混合模式要对雾与颜色做不同的处理

<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">

posted @ 2019-02-27 20:24  CloudLiu  阅读(1273)  评论(0编辑  收藏  举报