特效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;">


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM