screeneffect

package
v1.170.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package screeneffect は画面全体に適用するポストプロセスエフェクトを提供する。

責務:

  • ゲーム描画後の画面全体へのエフェクト適用
  • シェーダーベースのビジュアルエフェクト管理
  • オフスクリーンバッファの管理

使い方:

// パイプラインの初期化
pipeline := screeneffect.NewPipeline(screeneffect.NewRetroFilter())

// 描画ループ内で使用
offscreen := pipeline.Begin(width, height)
// ... offscreenに描画 ...
pipeline.End(screen) // フィルタを適用して画面に描画

仕様:

  • Filter: 画面エフェクトを表すインターフェース
  • Pipeline: Filterとオフスクリーンバッファを管理する
  • RetroFilter: 樽型歪み、色収差、ビネット、フリッカー、グロー効果を提供
  • オフスクリーンバッファを内部で管理し、画面サイズ変更に自動対応

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	// Apply はソース画像にエフェクトを適用して描画先に出力する
	Apply(dst, src *ebiten.Image)
}

Filter は画面エフェクトのインターフェース

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline はフィルタとオフスクリーンバッファを管理する

func NewPipeline

func NewPipeline(filter Filter) *Pipeline

NewPipeline は新しいPipelineを作成する

func (*Pipeline) Begin

func (p *Pipeline) Begin(width, height int) *ebiten.Image

Begin はオフスクリーンバッファを準備して返す nilレシーバの場合は何もせずnilを返す

func (*Pipeline) End

func (p *Pipeline) End(screen *ebiten.Image)

End はフィルタを適用して最終画面に描画する nilレシーバの場合は何もしない

type RetroFilter

type RetroFilter struct {
	// contains filtered or unexported fields
}

RetroFilter はレトロゲーム風のエフェクトを適用するフィルタ

func NewRetroFilter

func NewRetroFilter() (*RetroFilter, error)

NewRetroFilter は新しいレトロフィルタを作成する

func (*RetroFilter) Apply

func (f *RetroFilter) Apply(dst, src *ebiten.Image)

Apply はFilterインターフェースの実装 ソース画像にエフェクトを適用して描画先に出力する

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL