Help us understand the problem. What is going on with this article?

Siv3Dで透過PNGテクスチャの上端に線が入る

More than 5 years have passed since last update.

問題提起

Siv3D(Jan,2015)で透過PNGテクスチャを使ってキャラクタを動かすと,なぜか上端に線が入る.テクスチャを動かすと線が入ってしまうので消したい.

解決方法

SetSamplerState関数を使い,テクスチャのアドレスモードをClampに切り替えると,上端に線が入らなくなる.

# include <Siv3D.hpp>

void Main()
{
    Graphics2D::SetSamplerState(
        SamplerState(TextureAddressMode::Clamp, TextureFilter::MinMagMipLinear));

    while (System::Update())
    {
        // hogehoge
    }
}

注意点

Siv3D(2014,Nov)以前だと,SetSamplerState関数がGraphics名前空間に入っているので,見つからない時はそちらのほうを探してみるといいかもしれません.

GRGSIBERIA
なんでもやる人.元未踏クリエータ.三次元幾何学と音響工学を少々.
http://www.grgsiberia.net/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした