Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enabling and Disabling Effects

Raoul v. R edited this pageSep 24, 2021 ·8 revisions

TheEffectPass bakes effects into a single shader. This means that enabling or disabling one effect at runtime would require a recompilation of the shader program which blocks the render thread and causes a noticeable freeze. AnEffect should not be disabled by setting its blend function toBlendFunction.SKIP because this only prevents it from being integrated into the final shader. Many effects perform additional render operations that will still be executed even if they are excluded from the shader.

The recommended way to enable or disable effects on the fly is to prepare multipleEffectPass instances with the desiredEffect combinations ahead of time and to enable or disable these passes as needed usingPass.setEnabled(). This approach requires some planning ahead and uses a little bit more memory but is the most efficient solution. Note thatEffect instances can be reused in otherEffectPass instances to reduce memory usage.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp