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