OpenSiv3D icon indicating copy to clipboard operation
OpenSiv3D copied to clipboard

StencilStateを使用したいです

Open tyanmahou opened this issue 5 years ago • 1 comments

主にマスク処理などに使用するため、StencilStateを使用したいです。


また、提案ですが ScopedRenderStates2Dのようなスコープ制御で簡単にマスク処理ができると便利かもしれません。

以下のようなことがしたいイメージです

ScopedStencilMask::ScopedStencilMask(std::function<void()> base, s3d::StencilFunc stencilFunc, s3d::uint8 stencilValue):
	m_oldStencilState(Graphics2D::GetStencilState()),
	m_oldStencilValue(Graphics2D::GetStencilValue())
{
	Graphics2D::SetStencilState(StencilState::Replace);
	Graphics2D::SetStencilValue(stencilValue);

	base();

	Graphics2D::SetStencilState(StencilState::Test(stencilFunc));
}

tyanmahou avatar Sep 01 '19 05:09 tyanmahou

2D 描画でのステンシル実装は直近で予定はありません。 v0.4.1 からの ・マルチテクスチャ ・RenderTexture ・カスタムピクセルシェーダ で代替できないか検討してください。 どうしてもできない / 効率的にできない場合はまたご報告ください。

Reputeless avatar Sep 06 '19 13:09 Reputeless