- ShaderFX Camera: Symbian^3 and later
- ShaderFX Photo: Symbian^3 and later
- ShaderFX for Android 2.2 and higher
Taking snapshots is slow.
The camera uses a part of the memory used by the GPU. Thus, to allow bigger snapshots the camera is shut-down before processing which requires some time.
I need higher snapshot resolution! / The resolution of snapshots differs between shots!
The available memory for the GPU is very limited on mobile devices (e.g. 24 MB). ShaderFX frees as much memory as possible before each shot. Thus the captured image sizes vary from picture to picture.
If you need higher resolution pictures you can use CameraFX.
Creating Custom Effects
ShaderFX can be easily extended with your own effects using OpenGL ES 2 fragment shaders. Fragment shaders are processed by the GPU hardware and are very fast.
Steps required to add a shader to ShaderFX
- Create a shader following the format described below.
- Exit ShaderFX application if it is running.
- Copy the created shader and all required pictures such as textures (if any) and the application icon to "c:\data\Others\ShaderFX".
- The new shader will appear on the end of the shader list in ShaderFX when ShaderFX is started.
Creating custom shaders
ShaderFX uses a simple text-file format which includes the shader code and all information required by the shader, such as textures, shader name, and a shader icon. A sample shader code can be downloaded here. It is important that you exactly follow the format.
Each shader starts with some metadata, defining an icon (recommended dimension: 100x100 pixel, png format) and a shader name which are displayed in the shader selection list:
Name: My shader
Then four additional textures can be defined (note: if you don't need a texture, then leave it blank):
Each texture is loaded into the GPU and can later be referenced by "tex1", "tex2", "tex3", and "tex4". Texture unit "tex0" holds the camera image. Due to very strict memory limits you should use as little textures as possible and small texture sizes (for instance 64x64 pixel, png format recommended). The texture image files must be uploaded to the same location as the shader file on your phone (e.g. in Symbian "c:\data\Others\ShaderFX").
After definition of textures the shader code starts with (until the end of the shader file):
<shader code comes here>
The following variables are available in the shader:
varying highp vec4 texc;
The current texture coordinate.
varying mediump vec2 resolution;
The current resolution of the camera image texture (e.g. stored in texture unit 1).
varying mediump vec2 mouse;
The coordinate of the last touch event position (default: (0,0)). This variable can be used to allow user interaction with the shader.
varying mediump float time;
The seconds passed since the shader was loaded. This variable can be used to make nice animation effects.
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
uniform sampler2D tex3;
uniform sampler2D tex4;
The texture units 1-4 hold the textures defined above. If loading of a texture failed, then the texture unit is empty. Texture unit 0 holds the camera image.
Good sources for shaders
ShaderFX for Android uses a texture atlas because some devices do only support power-of-two textures (e.g. 32, 64, 512, 1024, etc.). Thus, coding shaders is a bit trickier because texture coordinates are not mapped between 0.0 and 1.0 but between 0.0 and 1.0/(image resolution). The variable "maxTexCoord" holds the maximum texture coordinates:
varying mediump vec2 maxTexCoord;
Besides it may be necessary to add the following lines of code at the beginning of your fragment shader code:
precision highp float;
On Android the custom shaders have to be copied to /sdcard/ShaderFX/shaders/.
If you created a cool shader you want to share with others, just email me the shader and I will offer it here for download!
ShaderFX provides functions to upload files (photos) directly to the following webservices:
The services are integrated into ShaderFX in such a way that ShaderFX "sees" and stores only anonymized user data in the shape of tokens which are generated by the webservices. ShaderFX neither "sees" nor stores private user data such as the user's username or password used for login.
ShaderFX's only purpose is to create photo albums and upload photos to webservices. ShaderFX does not alter or delete any data on the webservice. ShaderFX does not download or post any other information than specified by the user.
ShaderFX uses HTTPS protocol which uses encryption for data transmission.