Replies: 2 comments 1 reply
-
Thanks for this Tony, is this enabled in the Steam retail version now? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Not yet. It is disabled in most binary distributions for better compatibility, except for the pre-built runtime for windows here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Bitty Engine supports to make fullscreen effect using GLSL shaders. This feature is experimental that might not compatible with all platforms, so it's not enabled in the builds for better compatibility. Change the flag in source code to
BITTY_EFFECTS_ENABLED=1
and compile from source to enable it.Glance
To put it simply, Bitty Engine loads "../effects/default.json" for customized shader, the related files come as following for example.
"../effects/default.json":
"../effects/crt.png":
"../effects/crt.vs":
"../effects/crt.fs":
Material format
The format is explained with the following example:
The "vs" and "fs" entries specify the vertex and fragment shaders respectively.
The "textures" array specifies none or a number of textures injected to the shader.
The "uniforms" array specifies none or a number of uniform data injected to the shader.
The "clear_color" specifies the clear color in form of
[R, G, B, A]
.The "texture_min_filter", "texture_mag_filter" entries specify how to filter textures, the value can be one in "nearest", "linear".
The "texture_wrap_s", "texture_wrap_t" entries specify how to wrap textures, the value can be one in "repeat", "clamp", "clamp_to_edge".
Shader API
Resolution
: the renderer recolution as[width, height, 1/width, 1/height]
Canvas
: the canvas recolution as[width, height, 1/width, 1/height]
Time
: the time factor as[sec, min, hr]
, where the value ofsec
comes with range [0.0, 1.0),min
comes with range [0.0, 60.0),hr
comes with range [0.0, ∞)ProjMatrix
: the projection matrixPosition
: the position entryUV
: the uv entry to sample canvasColor
: the color entryFor sampling the canvas texture, use
uniform sampler2D Texture;
, for sampling extra textures, useuniform sampler2D Texture1;
,uniform sampler2D Texture2;
...Lua API
Application.setEffect(material)
: specifies the effect materialmaterial
: the material string, in the same format of "../effects/example.json"Application.setEffect()
: resets the effect material to defaultApplication.setEffectUniform(name, data)
: passes effect uniform from Lua to GLSLname
: the uniform name stringdata
: the specific data to set, can be one type innumber
,Vec2
,Vec3
,Vec4
,Texture
,Image
Beta Was this translation helpful? Give feedback.
All reactions