aboutsummaryrefslogtreecommitdiff
path: root/system/shaders
diff options
context:
space:
mode:
authordavilla <davilla@svn>2010-05-18 16:11:14 +0000
committerdavilla <davilla@svn>2010-05-18 16:11:14 +0000
commit615289266611cd07330b141dfffb1881ea2791d3 (patch)
tree524dc72a15e1162b162a0277efefa0d084e7c4e2 /system/shaders
parenta13b67898f84f3bbdb056c6d17407d2cc8d5b282 (diff)
[arm] 1) improve GUI framerate from 7 to 50+fps @1280x1024 by using multiple shaders, 2) fixes blending issues (colors were not normalized), 3) reduced number of glDrawElement calls to 1 per string instead of 1 per character, This can be improved again by refactoring the GUIFontTTF class to directly generate the VBO necessary for this call. A very big thanks to Phaeodaria (trac #9217) for his work on this
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30290 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r--system/shaders/guishader_frag0.glsl12
-rw-r--r--system/shaders/guishader_frag1.glsl12
-rw-r--r--system/shaders/guishader_frag2.glsl12
-rw-r--r--system/shaders/guishader_frag3.glsl12
4 files changed, 48 insertions, 0 deletions
diff --git a/system/shaders/guishader_frag0.glsl b/system/shaders/guishader_frag0.glsl
new file mode 100644
index 0000000000..478c601616
--- /dev/null
+++ b/system/shaders/guishader_frag0.glsl
@@ -0,0 +1,12 @@
+precision mediump float;
+uniform sampler2D m_samp0;
+uniform sampler2D m_samp1;
+varying vec4 m_cord0;
+varying vec4 m_cord1;
+varying vec4 m_colour;
+uniform int m_method;
+
+void main ()
+{
+ gl_FragColor = m_colour;
+}
diff --git a/system/shaders/guishader_frag1.glsl b/system/shaders/guishader_frag1.glsl
new file mode 100644
index 0000000000..73c6f3929f
--- /dev/null
+++ b/system/shaders/guishader_frag1.glsl
@@ -0,0 +1,12 @@
+precision mediump float;
+uniform sampler2D m_samp0;
+uniform sampler2D m_samp1;
+varying vec4 m_cord0;
+varying vec4 m_cord1;
+varying vec4 m_colour;
+uniform int m_method;
+
+void main ()
+{
+ gl_FragColor.rgba = texture2D(m_samp0, m_cord0.xy).bgra;
+}
diff --git a/system/shaders/guishader_frag2.glsl b/system/shaders/guishader_frag2.glsl
new file mode 100644
index 0000000000..095eecc11e
--- /dev/null
+++ b/system/shaders/guishader_frag2.glsl
@@ -0,0 +1,12 @@
+precision mediump float;
+uniform sampler2D m_samp0;
+uniform sampler2D m_samp1;
+varying vec4 m_cord0;
+varying vec4 m_cord1;
+varying vec4 m_colour;
+uniform int m_method;
+
+void main ()
+{
+ gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra;
+}
diff --git a/system/shaders/guishader_frag3.glsl b/system/shaders/guishader_frag3.glsl
new file mode 100644
index 0000000000..cb44cda585
--- /dev/null
+++ b/system/shaders/guishader_frag3.glsl
@@ -0,0 +1,12 @@
+precision mediump float;
+uniform sampler2D m_samp0;
+varying vec4 m_cord0;
+varying vec4 m_colour;
+
+void main ()
+{
+ gl_FragColor.r = m_colour.r;
+ gl_FragColor.g = m_colour.g;
+ gl_FragColor.b = m_colour.b;
+ gl_FragColor.a = texture2D(m_samp0, m_cord0.xy).a;
+}