「Metalでテクスチャから補正せずにサンプリングする」の版間の差分
ページの作成:「アップルが公式配布しているMetalでコンピュートシェーダーを叩く超入門的なサンプルプログラム「Hello Compute」とい…」 |
編集の要約なし |
||
| 25行目: | 25行目: | ||
const half4 colorSample = colorTexture.sample (textureSampler, in.textureCoordinate); | const half4 colorSample = colorTexture.sample (textureSampler, in.textureCoordinate); | ||
これどうするんだと思ったが[[テクスチャ]]にreadメソッドを発見。 | |||
サンプラーを経由せずにテクスチャから[[ピクセル]]を読み取ればいいようだ。 | |||
ushort w = colorTexture.get_width(); | ushort w = colorTexture.get_width(); | ||
ushort h = colorTexture.get_height(); | ushort h = colorTexture.get_height(); | ||