【问题标题】:Saturation and shockwave (ripple) effects饱和和冲击波(波纹)效果
【发布时间】:2013-02-04 14:13:53
【问题描述】:

目前,我在我的 2D 游戏中使用饱和效果,但我对 HLSL 很陌生,而且很迷茫。

    protected override void LoadContent()
    {
    ...things to load...
        //saturation
        desaturateEffect = Content.Load<Effect>("desaturate");
    }

    protected override void Draw(GameTime gameTime)
    {
        desaturateEffect.Parameters["saturationLevel"].SetValue(1 * Life / LifeMax);
        spriteBatch.Begin(SpriteSortMode.Deferred,
                          BlendState.AlphaBlend,
                          SamplerState.LinearClamp,
                          null,
                          null,
                          desaturateEffect,
                          transform);
        ...things to draw...
        spriteBatch.End();
    }

我认为它是一个像素着色器,但我不知道它是否是一个后处理效果。你能解释一下post-processingothers 之间的区别吗? 例如,此效果应用于spriteBatch.begin()。对于其他人,它们在哪里应用?

第二件事,我想使用冲击波效果(或涟漪效果),它也是后处理吗?

希望你能指导我。

【问题讨论】:

    标签: c# xna shader effects


    【解决方案1】:

    说真的,我已经搜索了几天,但没有找到任何关于此的内容。但是在发布这个主题将近一个小时后,我发现这个回答了我的问题......

    http://www.stromcode.com/2008/03/09/intro-to-effects-and-post-processing/

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-12
    • 1970-01-01
    • 2012-12-08
    • 2017-07-20
    • 1970-01-01
    • 1970-01-01
    • 2017-05-01
    • 2011-11-30
    相关资源
    最近更新 更多