利用者:Matpi/BGE 2DFilters 1

提供: wiki
< 利用者:Matpi
2018年6月29日 (金) 06:14時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Planning

Goal

Enhance the current 2D Filters system in the BGE - make it easier to use and add features to it.

Proposed changes

  • New uniforms
New uniforms will add access to basic and useful uniforms for GLSL shaders without having to use logic bricks or Python. These uniforms would be:
- World colors, i.e. Ambient/Mist/Background
This makes it convenient to create background shaders such as gradient skies, etc. using colors defined in the UI.
- Position/Orientation/Perspective of the current camera
In the same context of gradient skies, this allows to create a correct gradient with respect to the direction the camera looks into.
  • Variable strength parameter
It can be useful to only add a subtle shader effect rather than replacing the rendered texture with it. A "strength" parameter added to some of the 2D Filter Actuators would fulfill this task.
A currently open revision implements this, but needs more work: D1375
  • Interaction with VideoTextures
see VideoTexture enhancement

Implementation

  • New Uniforms
- World colors: Retrieved from KX_GetActiveScene()->GetWorldInfo(); some getters would be added to KX_WorldInfo.
  • Variable strength parameter
Ideally using function like glAccum in the filter rendering method.