home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / xbmc-9.11.exe / system / shaders / yuv2rgb_basic.glsl < prev    next >
Encoding:
Text File  |  2009-12-23  |  618 b   |  29 lines

  1. #if(XBMC_texture_rectangle)
  2. # extension GL_ARB_texture_rectangle : enable
  3. # define texture2D texture2DRect
  4. # define sampler2D sampler2DRect
  5. #endif
  6.  
  7. uniform sampler2D m_sampY;
  8. uniform sampler2D m_sampU;
  9. uniform sampler2D m_sampV;
  10. varying vec2      m_cordY;
  11. varying vec2      m_cordU;
  12. varying vec2      m_cordV;
  13.  
  14. uniform mat4      m_yuvmat;
  15.  
  16.  
  17. void main()
  18. {
  19.   vec4 yuv, rgb;
  20.   yuv.rgba = vec4( texture2D(m_sampY, m_cordY).r
  21.                  , texture2D(m_sampU, m_cordU).r
  22.                  , texture2D(m_sampV, m_cordV).r
  23.                  , 1.0 );
  24.  
  25.   rgb   = m_yuvmat * yuv;
  26.   rgb.a = gl_Color.a;
  27.   gl_FragColor = rgb;
  28. }
  29.