MENU

BLOG

Good news everyone! The latest SuperGNES update includes support for shaders! We provide a CRT and grayscale shader by default, with support for your own. We are using OpenGL ES for the backend, so bear that in mind.

Our shaders are based on the XmlShaderFormat. We support the <vertex> and <fragment> tags, and we pass rubyTextureSize, rubyOutputSize, and rubyInputSize. We additionally pass in the time as a uniform float to the fragment shader, which represents the current millisecond. This is used to achieve the vertical animation effect in the “Scanline” version of our CRT shader. The <name>, <notes>, and <version> tags are all required.

Below is our default shader, which passes the image through unaltered. Place your custom shaders (ending in .xml) in the following path: /sdcard/supergnes/shaders/ You will need to create the supergnes/shaders/ folders yourself.

<?xml version="1.0" encoding="UTF-8"?>
<shader>
<name>SuperGNES Default Shader</name>
<notes>Extraordinarily ordinary!</notes>
<version>1</version>
<fragment><![CDATA[
precision mediump float;
uniform sampler2D u_Texture;
varying vec2 v_TexCoordinate;
void main() {
	gl_FragColor = texture2D(u_Texture, v_TexCoordinate);
}
]]></fragment>
<vertex><![CDATA[
attribute vec4 a_Position;
attribute vec2 a_TexCoordinate;
varying vec2 v_TexCoordinate;
void main() {
	v_TexCoordinate = a_TexCoordinate;
	gl_Position = a_Position;
}
]]></vertex>
</shader>

Please download our preset shaders from within SuperGNES under the Video FX setting. To learn more about GL Shaders check out https://www.google.com/search?q=glsl+es+shader+tutorial

Date posted: February 20, 2013 | Author: | Comments Off

Categories: General

Comments are closed.