'近邻'放大 [英] 'Nearest Neighbor' zoom

查看:117
本文介绍了'近邻'放大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我画一个拉伸的Texture2D ,像素收到一个模糊般的效果。

When I draw a stretched Texture2D, the pixels receive a Blur-like effect.

我想用在我的游戏像素化的图形和想知道如何有利于最简单的近邻变焦禁用它。

I want to use 'pixelated' graphics in my game and would like to know how to disable this in favor of the simplest nearest neighbor zoom.

我已经创造了这个画面来加以说明:(X4变焦)

I've created this picture for illustration: (x4 zoom)

在什么样的方式,我可以做到这一点?

In what way can I accomplish this?

推荐答案

在XNA 4,改变你SpriteBatch.Begin()到采样状态设置为 SamplerState.PointClamp

In XNA 4, change your SpriteBatch.Begin() to set the sampler state to SamplerState.PointClamp

这篇关于'近邻'放大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆