GraphiteEditor / GraphiteEditor/Graphite

Use a texture sampler instead of looping over pixels in the Blend node (and others)

オープン
#1,247 コメント 0 件 リアクション 1 件 担当者 1 名 @TrueDoctor が担当を希望しています GitHub で見る
Graphene
主要言語
Rust
スター
27.2k
フォーク
1.3k
平均マージ
20時間 5分
マージ済み PR(30日)
57

説明

The Blend node loops through all the pixels, which is a limitation causing ugly texture rendering and especially bad handling or rotation (and scaling) because it performs something like nearest neighbor sampling. The result is a very ugly image output and artifacts like #1132 and pixels "jumping" with an offset causing a blended image to appear one pixel to the side of its original.

Even on GPU, this for loop is converted into a parallelized execution of the loop's body, meaning the GPU is still just performing the nearest neighbor lookup in parallel. Instead, we want to utilize the texture sampler capabilities of the GPU, which would perform accurate pixel lookups with built-in texture interpolation (bilinear or bicubic instead of nearest neighbor). An added challenge is that `rust-gpu` currently does not provide any way to run an equivalent texture sampler concept on the CPU, since its crate provides the `Image` and `Sampler` API only when compiling to the GPU architecture (see https://github.com/EmbarkStudios/rust-gpu/issues/1065). Even if that blocks the CPU implementation, this issue should at least be able to be solved on GPU.

This probably affects more than just the Blend node— basically anything that needs to take an image input and sample from it with some offset/scale/rotation.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。