notex_ps.glsl
上传用户:xhbjoy
上传日期:2014-10-07
资源大小:38068k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /******************************************************************************
  2. Copyright (c) W.J. van der Laan
  3. Permission is hereby granted, free of charge, to any person obtaining a copy of 
  4. this software  and associated documentation files (the "Software"), to deal in 
  5. the Software without restriction, including without limitation the rights to use, 
  6. copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
  7. Software, and to permit persons to whom the Software is furnished to do so, subject 
  8. to the following conditions:
  9. The above copyright notice and this permission notice shall be included in all copies 
  10. or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
  12. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
  13. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
  14. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
  15. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
  16. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. ******************************************************************************/
  18. /** Deferred shading framework
  19. // W.J. :wumpus: van der Laan 2005 //
  20. Material shader: Single colour phong
  21. */
  22. varying vec3 normal;
  23. varying vec2 texCoord0;
  24. varying float depth;
  25. uniform float specularity;
  26. uniform vec3 colour;
  27. void main()                    
  28. {
  29.     gl_FragData[0].rgb = colour;
  30. gl_FragData[0].a = specularity;
  31. gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
  32. gl_FragData[1].w = depth;
  33. }