grass_map.glslf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #version GLSL_VERSION
  2. /*==============================================================================
  3. VARS
  4. ==============================================================================*/
  5. #var DYNAMIC_GRASS_SIZE 0
  6. #var DYNAMIC_GRASS_COLOR 0
  7. /*==============================================================================
  8. INCLUDES
  9. ==============================================================================*/
  10. #include <precision_statement.glslf>
  11. #include <std.glsl>
  12. /*==============================================================================
  13. SHADER INTERFACE
  14. ==============================================================================*/
  15. #if DYNAMIC_GRASS_SIZE
  16. # if DYNAMIC_GRASS_COLOR
  17. GLSL_IN vec4 v_grass_params;
  18. # else
  19. GLSL_IN float v_grass_params;
  20. # endif
  21. #else
  22. # if DYNAMIC_GRASS_COLOR
  23. GLSL_IN vec3 v_grass_params;
  24. # endif
  25. #endif
  26. //------------------------------------------------------------------------------
  27. GLSL_OUT vec4 GLSL_OUT_FRAG_COLOR;
  28. /*==============================================================================
  29. MAIN
  30. ==============================================================================*/
  31. void main(void) {
  32. #if DYNAMIC_GRASS_SIZE
  33. # if DYNAMIC_GRASS_COLOR
  34. GLSL_OUT_FRAG_COLOR = v_grass_params;
  35. # else
  36. GLSL_OUT_FRAG_COLOR = vec4(v_grass_params, vec3(1.0));
  37. # endif
  38. #else
  39. # if DYNAMIC_GRASS_COLOR
  40. GLSL_OUT_FRAG_COLOR = vec4(1.0, v_grass_params);
  41. # else
  42. // 1 scale, white color
  43. GLSL_OUT_FRAG_COLOR = vec4(1.0);
  44. # endif
  45. #endif
  46. }