screen.shader
上传用户:qccn516
上传日期:2013-05-02
资源大小:3382k
文件大小:1k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. /* screen shader
  2.  *
  3.  * written by Alexander Zaprjagaev
  4.  * frustum@frustum.org
  5.  * http://frustum.org
  6.  */
  7. <vertex_local0> time
  8. <vertex>
  9. !!ARBvp1.0
  10. ATTRIB xyz = vertex.position;
  11. ATTRIB texcoord = vertex.texcoord;
  12. PARAM mvp[4] = { state.matrix.mvp };
  13. PARAM time = program.local[0];
  14. DP4 result.position.x, mvp[0], xyz;
  15. DP4 result.position.y, mvp[1], xyz;
  16. DP4 result.position.z, mvp[2], xyz;
  17. DP4 result.position.w, mvp[3], xyz;
  18. MOV result.texcoord[0], texcoord;
  19. TEMP offset;
  20. MUL offset, time, { 27,13,0,0 };
  21. MAD result.texcoord[1], texcoord, { 2,2,0,0 }, offset;
  22. END
  23. <fragment>
  24. !!ARBtec1.0
  25. replace texture
  26. END
  27. /*!!ARBfp1.0
  28. TEMP color;
  29. TEX color, fragment.texcoord[0], texture[0], 2D;
  30. #TEMP noise;
  31. #TEX noise, fragment.texcoord[1], texture[1], 2D;
  32. #TEMP gray;
  33. #DP3 gray, color, { 0.2126, 0.7152, 0.0722, 0.0 };
  34. #MUL gray, gray, 0.5;
  35. #MAD color, color, 0.5, gray;
  36. #MAD result.color, noise, 0.2, color;
  37. MOV result.color, color;
  38. END
  39. */