emboss.frag 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* MegaZeux
  2. *
  3. * Copyright (C) 2008 Joel Bouchard Lamontagne <logicow@gmail.com>
  4. * Copyright (C) 2009 Alistair John Strachan <alistair@devzero.co.uk>
  5. * Copyright (C) 2017 Dr Lancer-X <drlancer@megazeux.org>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #version 110
  22. uniform sampler2D baseMap;
  23. varying vec2 vTexcoord;
  24. void main( void )
  25. {
  26. vec2 pos = vec2(vTexcoord.x, vTexcoord.y);
  27. vec2 posA = vec2(vTexcoord.x - 0.0005, vTexcoord.y + 0.0007);
  28. vec2 posB = vec2(vTexcoord.x + 0.0006, vTexcoord.y - 0.001);
  29. gl_FragColor =
  30. texture2D(baseMap, pos) * 2.0 -
  31. texture2D(baseMap, posA) * 2.0 +
  32. texture2D(baseMap, posB);
  33. }