XNA 4.0:根据背景颜色混合不需要的纹理

时间:2012-04-22 12:41:07

标签: c# xna

我发现了在背景上绘制不透明前景纹理的问题。前景按钮纹理以某种方式与背景混合,您可以看到顶部按钮和最低按钮之间的差异。最低的按钮比顶部按钮轻一点。

button texture is depended on backgorund color

我在游戏创作中设置了这样的图形:

        // Set up graphics
        GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
        graphics.PreferredBackBufferWidth = 800;
        graphics.PreferredBackBufferHeight = 480;
        graphics.SynchronizeWithVerticalRetrace = true;

        // antialiasing
        graphics.PreferMultiSampling = true;
        graphics.ApplyChanges();

并使用带有Color.White参数的空参数列表“spriteBatch.Begin();”没有任何混合的电话。

1 个答案:

答案 0 :(得分:0)

颜色相同,只是看起来不是:)

在这里,我复制粘贴顶部旁边的图像底部:

enter image description here

这是一种叫做simultaneous brightness contrast的视错觉。